Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        startTime = Time.time;

        GameObject gameControllerObject = GameObject.FindWithTag("GameLR");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameControllerLR>();
        }

        if (gameController == null)
        {
            Debug.Log("Cannot find 'GameControllerLR' script!");
        }
    }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        //gets end destination for the target
        destination = new Vector3(transform.position.x * -1, transform.position.y, 1);
        depth       = transform.position.z;

        // cannot pass gameController at unity editor interface
        // have to do this to FIND game controller
        GameObject gameControllerObject = GameObject.FindWithTag("GameLR");

        //if (gameControllerObject != null)
        //{
        gameController = gameControllerObject.GetComponent <GameControllerLR>();
        //}

        //if (gameController == null)
        //{
        //    Debug.Log("Cannot find 'GameController' script!");
        //}
    }