Example #1
0
    void Start()
    {
        rotateLeft      = GameObject.Find("RotateLeft");
        rotateLeftImage = rotateLeft.GetComponent <Image>();

        rotateRight      = GameObject.Find("RotateRight");
        rotateRightImage = rotateRight.GetComponent <Image>();

        reverse      = GameObject.Find("Reverse");
        reverseImage = reverse.GetComponent <Image>();

        gm  = GameManager.GMinstance;
        cam = CameraMove2.camInstance;
        gp  = GamePlay.gamePlayInstance;
    }
Example #2
0
    void Awake()
    {
        if (_camInstance == null)
        {
            _camInstance = this;
            // Stops this object from being destroyed when loading scenes
            DontDestroyOnLoad(_camInstance.gameObject);
        }
        else
        {
            //If a Singleton already exists and you find
            //another reference in scene, destroy it!
            if (this != _camInstance)
            {
                Destroy(this.gameObject);
            }
        }

        // Setting up the reference for player
        player = GameObject.FindGameObjectWithTag("Player").transform;
    }