void Awake() { if (instance == null) { instance = this; } }
private float rot_z; //围绕z轴旋转量 private void Start() { uIContoller = GameObject.Find("UIController").GetComponent <UIContoller>(); enemyTank = (GameObject)Resources.Load("Prefabs/Enemy"); if (uIContoller.isAntiAI) { //生成敌人 InstantiateEnemy(); } }
/// <summary> /// using ui controller /// </summary> private void Awake() { if (uIContoller == null) { uIContoller = this; } if (uIContoller != this) { Destroy(gameObject); } DontDestroyOnLoad(UIContoller.uIContoller.gameObject); }
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); }
void Awake() { instance = this; }
void Start() { ui = FindObjectOfType <UIContoller>(); layout = FindObjectOfType <GridGenerator>(); }