예제 #1
0
    private void Start()
    {   //检测游戏主函数存在并且给出提示
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController_Sripts>();
        }
        if (gameControllerObject == null)
        {
            Debug.Log("Cannot find 'GameController' scripts");
        }
    }
예제 #2
0
    void Start()
    {
        GetComponent <Rigidbody>().velocity = transform.forward * speed;
        //检测游戏主函数存在并且给出提示
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController_Sripts>();
        }
        if (gameControllerObject == null)
        {
            Debug.Log("Cannot find 'GameController' scripts");
        }
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        GetComponent <Rigidbody>().angularVelocity = Random.insideUnitSphere * tumble;
        //检测游戏主函数存在并且给出提示
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController_Sripts>();
        }
        if (gameControllerObject == null)
        {
            Debug.Log("Cannot find 'GameController' scripts");
        }
    }