Example #1
0
    void OnTriggerEnter()
    {

        switch (cubeState)
        {
            case EStateCube.GOALMODE:
                // Win some points
                OnDestroyObject();
                transform.parent.GetComponent<Score>().TouchedCube();
                cubeState = EStateCube.DESTROY;
                break;
        }
    }
Example #2
0
	// Use this for initialization
	void Start () {
        cubeState = EStateCube.NOTHING;
        timeLeft = GamePlay.timeBetweenEachCubeApparition;
 
        if (!transform.parent.name.Contains("Cube"))
        {   
            GameObject child = GameObject.Instantiate(this.gameObject);
            child.transform.parent = this.transform;
            Destroy(GetComponent<Renderer>());
            Destroy(child.GetComponents<BoxCollider>()[1]);
            Destroy(child.GetComponent<Cube>());
            BeginningColor = transform.GetChild(0).GetComponent<Renderer>().material.color;
        }

	}
Example #3
0
 public virtual void OnDeactivate()
 {
     resetColor = !resetColor;
     cubeState = EStateCube.NOTHING;
 }
Example #4
0
 public virtual void OnActivateGoal()
 {
     transform.parent.GetComponent<Score>().NewGoalCube();
     cubeState = EStateCube.GOALMODE;
 }