public void launchUFO() { int trailNum = scene.getTrailNum() > 3 ? 3 : scene.getTrailNum(); Debug.Log("发射!"); if (!UFOFactory.getInstance().isLaunching()) { StartCoroutine(launchUFOs(trailNum)); } }
// Use this for initialization void Start() { sceneController = SceneController.GetInstance(); actionManager = ActionManager.GetInstance(); ufoFactory = UFOFactory.getInstance(); actionManager = ActionManager.GetInstance(); ufoFactory = UFOFactory.getInstance(); bulletFactory = BulletFactory.getInstance(); }
IEnumerator launchUFOs(int roundNum) { for (int i = 0; i < roundNum; i++) { GameObject UFO = UFOFactory.getInstance().getUFO(); UFO.transform.position = launcher.transform.position; UFO.GetComponent <MeshRenderer>().material = getMaterial(scene.getTrailNum()); adapter.addForceOnUFO(UFO); yield return(new WaitForSeconds(LAUNCH_GAP)); } }
IEnumerator launchUFOs(int roundNum) { for (int i = 0; i < roundNum; i++) { GameObject UFO = UFOFactory.getInstance().getUFO(); UFO.transform.position = launcher.transform.position; UFO.GetComponent <MeshRenderer>().material = getMaterial(scene.getTrailNum()); Vector3 force = getRandomForce(); UFO.GetComponent <Rigidbody>().AddForce(force, ForceMode.Impulse); yield return(new WaitForSeconds(LAUNCH_GAP)); } }
public void hitUFO(Vector3 mousePos) { Ray ray = Camera.main.ScreenPointToRay(mousePos); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.collider.gameObject.tag.Equals("UFO")) { createExplosion(hit.collider.gameObject.transform.position); scene.addScore(); UFOFactory.getInstance().RecyclingUFO(hit.collider.gameObject); } } }
public void GameOver() { CancelInvoke("CreateUFO"); CancelInvoke("DisplayNum"); for (int i = 0; i < UFOFactory.getInstance().usingUFO.Count; i++) { DestroyObject(UFOFactory.getInstance().usingUFO [i]); } for (int i = 0; i < UFOFactory.getInstance().usingUFO.Count; i++) { UFOFactory.getInstance().usingUFO.RemoveAt(i); } for (int j = 0; j < ExplosionList.Count; j++) { DestroyObject(ExplosionList [j]); } for (int j = 0; j < ExplosionList.Count; j++) { ExplosionList.RemoveAt(j); } Director.getInstance().game_state = GameState.DISPLAY_SCORE; this.DisplayScore(); }
void Start() { ufoFactory = UFOFactory.getInstance(); bulletFactory = BulletFactory.getInstance(); }
private void Awake() { UFOFactory.getInstance().initItems(ufoItem); }
// Update is called once per frame void Update() { UFOFactory.getInstance().detectLandingUFOs(); }
private void OnMouseDown() { UFOFactory.getInstance().releaseUFO(gameObject, true); Director.getInstance().score += 2; }
public void CreateUFO() { UFOFactory.getInstance().getNewUFO(); }