// Update is called once per frame protected new void Update() { if (!sceneController.chose) { if (sceneController.count < 10) { if (timer != 0) { timer -= Time.deltaTime; if (timer < 0) { timer = Random.Range(3 - sceneController.level, 6 - sceneController.level); if (sceneController.count < 5) { fly = CCFly.GetSSAction(); sceneController.number++; this.RunAction(sceneController.disk.GetDisk().Disk, fly, this); } else { int number = Random.Range(1, 3); for (; number > 0; number--) { fly = CCFly.GetSSAction(); sceneController.number++; this.RunAction(sceneController.disk.GetDisk().Disk, fly, this); } } } } if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.transform.tag == "Disk") { sceneController.score(hit.transform.name); sceneController.disk.destroy(hit.transform.name); } } } base.Update(); } } }
public static CCFly GetSSAction() { CCFly action = ScriptableObject.CreateInstance <CCFly>(); return(action); }