Beispiel #1
0
    void AddNewEntity()
    {
        Vector3 pos;
        UInt16  entKey = GameManager.instance.GetEntityKeyRandomly();
        Entity  ent    = PoolingManager.InstantiateByPooling(entKey);

        if (ent != null)
        {
            ent.SetParent(this);
            ent.transform.localScale = Vector3.one;

            //int cnt = owner.entityList.Count + 1;
            if (squareData.reversal == true)
            {
                pos = new Vector3(0, -GameDatabase.instance.tileHeight, 0);
            }
            else
            {
                pos = new Vector3(0, GameDatabase.instance.tileHeight, 0);
            }

            ent.transform.localPosition = pos;
            ent.gameObject.SetActive(false);
            entityList.Add(ent);
        }
    }