RedScript | An Elixir Flavored Language for the Browser | Code Editor library
kandi X-RAY | RedScript Summary
kandi X-RAY | RedScript Summary
An Elixir Flavored Language for the Browser
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of RedScript
RedScript Key Features
RedScript Examples and Code Snippets
Community Discussions
Trending Discussions on RedScript
QUESTION
I'm creating a small game project (first time learning C# so the coding is pretty terrible).
I have a yellow cube that changes colour to green after both the yellow and blue cube have been selected by bools. I got that code working and copied it over to purple script on the blue cube to change it to purple. Playing the game executes the green colour script even when clicking the red cube and manually checking the bools in the inspector ignores the purple action part of the script.
The code works by selecting a cube and selecting another cube, with the 1st cube executing the script that causes a colour change and kills the second cube. Blue cube and yellow cube selected turns a blue cube into a green cube and kills yellow cube. When I wanted to select a blue cube and red cube by my modified green cube code, the code doesn't execute.
Blue Script on the cube (working)
...ANSWER
Answered 2019-Jun-14 at 06:40you should not have 3 classes for each cube...You should have a class attached to all the cubes, and a variable that sets the inspector what color the cube has,and bool actived. Then have a main class that contains an array with all the cubes. And you need an abstract class that has an abstract method Activate, each cube extends the abstract class. In the main class when you click on a cube, take the abstract class from it and call the method Activate.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install RedScript
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page