예제 #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #2
0
    private float rot_z;                                        //围绕z轴旋转量

    private void Start()
    {
        uIContoller = GameObject.Find("UIController").GetComponent <UIContoller>();
        enemyTank   = (GameObject)Resources.Load("Prefabs/Enemy");

        if (uIContoller.isAntiAI)
        {
            //生成敌人
            InstantiateEnemy();
        }
    }
예제 #3
0
 /// <summary>
 /// using ui controller
 /// </summary>
 private void Awake()
 {
     if (uIContoller == null)
     {
         uIContoller = this;
     }
     if (uIContoller != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(UIContoller.uIContoller.gameObject);
 }
예제 #4
0
    private void Start()
    {
        uIContoller = GameObject.Find("UIController").GetComponent <UIContoller>();             //获取脚本
        player      = GameObject.Find("Player").GetComponent <Tank>();
        wingman     = GameObject.Find("Wingman").GetComponent <Tank>();
        panel_back  = GameObject.Find("Panel_Back");
        panel_over  = GameObject.Find("Panel_Over");
        fruit       = panel_over.transform.GetChild(1).GetComponent <Text>();

        panel_back.SetActive(false);
        panel_over.SetActive(false);
    }
예제 #5
0
	void Awake() {
		instance = this;
	}
예제 #6
0
 void Start()
 {
     ui     = FindObjectOfType <UIContoller>();
     layout = FindObjectOfType <GridGenerator>();
 }