コード例 #1
0
    public void launchUFO()
    {
        int trailNum = scene.getTrailNum() > 3 ? 3 : scene.getTrailNum();

        Debug.Log("发射!");
        if (!UFOFactory.getInstance().isLaunching())
        {
            StartCoroutine(launchUFOs(trailNum));
        }
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        sceneController = SceneController.GetInstance();
        actionManager   = ActionManager.GetInstance();
        ufoFactory      = UFOFactory.getInstance();

        actionManager = ActionManager.GetInstance();
        ufoFactory    = UFOFactory.getInstance();
        bulletFactory = BulletFactory.getInstance();
    }
コード例 #3
0
 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));
     }
 }
コード例 #4
0
ファイル: UFOController.cs プロジェクト: SHIKD-pu/3D-Game
    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));
        }
    }
コード例 #5
0
    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);
            }
        }
    }
コード例 #6
0
 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();
 }
コード例 #7
0
 void Start()
 {
     ufoFactory    = UFOFactory.getInstance();
     bulletFactory = BulletFactory.getInstance();
 }
コード例 #8
0
ファイル: UFOFactoryBC.cs プロジェクト: SHIKD-pu/3D-Game
 private void Awake()
 {
     UFOFactory.getInstance().initItems(ufoItem);
 }
コード例 #9
0
 // Update is called once per frame
 void Update()
 {
     UFOFactory.getInstance().detectLandingUFOs();
 }
コード例 #10
0
 private void OnMouseDown()
 {
     UFOFactory.getInstance().releaseUFO(gameObject, true);
     Director.getInstance().score += 2;
 }
コード例 #11
0
 public void CreateUFO()
 {
     UFOFactory.getInstance().getNewUFO();
 }