Example #1
0
    private void Awake()
    {
//        mySnake = (GameObject) Instantiate(mySnake,transform.position,Quaternion.identity);
//        mySnake.name = "BlueHead";
        txtScore = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>();
        NodeMovement.SetSpeed(5f);
        SnakeHeadController.SetSpeed(5f);
        score  = 0;
        health = 3;
    }
Example #2
0
    IEnumerator Slowly(float _delay)
    {
        NodeMovement.SetSpeed(2f);
        SnakeHeadController.SetSpeed(2f);
        yield return(new WaitForSeconds(_delay));

        NodeMovement.SetSpeed(OldSpeed);
        SnakeHeadController.SetSpeed(OldSpeed);
        Destroy(gameObject);
    }