void Awake() { gameCS mainGame = GameObject.Find("mainGame").GetComponent <gameCS>(); cubesDictionary = mainGame.getCubesDictionary(); CreateGrid(); }
// Use this for initialization void Start() { bioStop(); GetComponent <Animation>().playAutomatically = false; maingameCS = GameObject.Find("mainGame").GetComponent <gameCS>(); //如果該生物在玩家清單,改變陣營為玩家。 LV = 50; //todo:應該記錄在生物表 checkBioCamp(); bioAction = ""; if (bioCamp == 1) { model = this.transform.Find("Model").gameObject; //todo:因為美術資源用別人的,只好先寫死 } if (bioCamp == 0) { model = this.transform.Find("Group Locator/Knight").gameObject; //todo:因為美術資源用別人的,只好先寫死 } allBiologys = maingameCS.getAllBiologys(); attackCoolDown = 15; actionSpeed = 15.2f; //todo:應該記錄在c_biology.json players = 3; target = null; rotateSpeed = 15; runBack = false; WalkSteptweek = 40; //todo:應該記錄在biologyList.json moveSpeed = 0.12f; //todo:應該記錄在c_ai.json runBackDist = 10f; //todo:應該記錄在c_ai.json seeMax = 10f; //todo:應該記錄在c_ai.json attackDistance = 2; //todo:應該記錄在c_ai.json catchSpeed = 0.05f; //todo:應該記錄在c_ai.json GameObject.Find("playerINFO/P3/name").GetComponent <Text>().text = this.name; GameObject.Find("playerINFO/P3/HPMAX").GetComponent <Text>().text = HPMAX.ToString("F0"); GameObject.Find("playerINFO/P3/HP").GetComponent <Text>().text = HP.ToString("F0"); GameObject.Find("playerINFO/P3/MP").GetComponent <Text>().text = MPMAX.ToString("F0"); moveSpeedMax = moveSpeed; startPos = this.transform.position; setNameText(); bioAnimation = "mWait"; Sphere3 = this.transform.position; gameBits = new gameBits(this); setTargeLine(); loadBiologyList(); setCollisionCubes(); dynamicCollision(); loadAnimation(); setEffect(); checkOder(); }
// Use this for initialization void Start() { maingameCS = GameObject.Find("mainGame").GetComponent <gameCS>(); targetMove = maingameCS.getCameraOffset(); var angles = transform.eulerAngles; x = angles.y; y = angles.x; finalX = x; transform.position = new Vector3(0.0f, 0.0f, -distance) + maingameCS.getPlayerPos() + targetMove; // Make the rigid body not change rotation if (GetComponent <Rigidbody>()) { GetComponent <Rigidbody>().freezeRotation = true; } mouseOrbitSet(); x = angles.y; y = angles.x; finalX = x; }