Пример #1
0
    // Use this for initialization
    void Start()
    {
        mpUIPlayGame = GameObject.FindObjectOfType <CUIPlayGame>();
        //findObjectOfType 하이어라키 상의 오브젝트를 불러옴
        mpUIPlayGame.SetScene(this);

        mpAlberto = Instantiate <CAlberto>(CRyuGameDataMgr.GetInst().PFAlberto, Vector3.zero, Quaternion.identity);
        mpAlberto.CreateAni();
        mpAlberto.SetScene(this);

        //this.DoCreateEnemy();
        mEnemyList = new List <CEnemy>();

        InvokeRepeating("DoCreateEnemy", 0.0f, 1.0f);
    }
Пример #2
0
    public void Create_Game()
    {
        int ti     = 0;
        int tCount = 0;

        mpDxGameOver.CreateRyu();
        mpDxGameOver.SetScene(this);
        mpDxGameOver.Hide();

        mpUIPlayGame.SetScene(this);

        mpAlberto = null;
        mpAlberto = Instantiate <CAlberto>(PFAlberto, Vector3.zero, Quaternion.identity) as CAlberto;
        mpAlberto.CreateAni();
        mpAlberto.SetScene(this);

        CSlime  tpSlime  = null;
        CRabbit tpRabbit = null;

        mEnemyList = new List <CEnemy>();

        for (int i = 1; i < 10; i++)
        {
            tpSlime = null;
            tpSlime = Instantiate <CSlime>(PFSlime, Vector3.zero, Quaternion.identity) as CSlime;
            tpSlime.transform.position   = new Vector3(-3.0f * Mathf.Pow(-1, i) * i, 0.0f, 0.0f);
            tpSlime.transform.localScale = new Vector3(Mathf.Pow(-1, i), 1, 1);
            mEnemyList.Add(tpSlime);

            tpRabbit = null;
            tpRabbit = Instantiate <CRabbit>(PFRabbit, Vector3.zero, Quaternion.identity) as CRabbit;
            tpRabbit.transform.position   = new Vector3(-6.0f * Mathf.Pow(-1, i) * i, 0.0f, 0.0f);
            tpRabbit.transform.localScale = new Vector3(Mathf.Pow(-1, i), 1, 1);
            mEnemyList.Add(tpRabbit);
        }

        tCount = mEnemyList.Count;

        for (ti = 0; ti < tCount; ti++)
        {
            mEnemyList[ti].CreateAni();
            mEnemyList[ti].SetScene(this);

            //mListSlime[ti].SetAlberto(mpAlberto);
            mEnemyList[ti].SetAlive(true);
            mEnemyList[ti].Show();
        }
    }