Example #1
0
    private void LoadShotCompleteCB(GameObject gameObj, System.Guid uid, params object[] param)
    {
        if (gameObj != null)
        {
            GameObject createObj = Instantiate(gameObj) as GameObject;

            createObj.transform.parent = GameManager.Instance.
                                         rootArray[(int)GameManager.eRootType.Type_Object].transform;
            createObj.transform.position   = effectDummy.position;
            createObj.transform.localScale = gameObj.transform.localScale;

            EnemyShot shot = createObj.GetComponent <EnemyShot>();
            if (shot != null)
            {
                shot.Init((int)param[0], (EnemyTable.TableRow)param[1], (Vector3)param[2], (Vector3)param[3]);
            }
        }
    }
Example #2
0
    private void SetShot()
    {
        int     hashID    = Animator.StringToHash(enemyStatus.table.attackEffectPath);
        Vector3 targetPos = GameManager.Instance.GetEnemyEndPos(enemyStatus.floorIndex);

        EnemyShot shot = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEnemyShotFromPool(hashID, out shot))
        {
            shot.Init(hashID, enemyStatus.table, effectDummy.position, targetPos);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadShotCompleteCB);
            PrefabManager.Instance.LoadPrefab(enemyStatus.table.attackEffectPath, System.Guid.NewGuid(),
                                              loadPrefabCB, hashID, enemyStatus.table, effectDummy.position, targetPos);
        }
    }