コード例 #1
0
ファイル: Tower.cs プロジェクト: 1010MMR/Portfolio
    public void Sell()
    {
        StopAllCoroutines();

        SpriteEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool((int)EffectTable.eEffectType.Type_Tower_Sell, out effect))
        {
            effect.Init(transform);
        }
        else
        {
            EffectTable.TableRow effectTable = null;
            if (EffectTable.Instance.FindTable((int)EffectTable.eEffectType.Type_Tower_Sell, out effectTable))
            {
                LoadAssetbundle.LoadPrefabCB loadPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDestroyEffectCompleteCB);
                PrefabManager.Instance.LoadPrefab(effectTable.effectPath, System.Guid.NewGuid(), loadPrefabCB, effectTable);
            }
        }

        if (TowerManager.Instance != null)
        {
            TowerManager.Instance.RemoveTowerList(this);
        }

        if (PoolManager.Instance != null)
        {
            PoolManager.Instance.AddTowerPool(this);
        }
        if (GameManager.Instance != null)
        {
            GameManager.Instance.AddGameGold(status.GetSellPrice);
        }
    }
コード例 #2
0
 private void InitHpBar()
 {
     if (hpBar != null)
     {
         SetHpBar();
     }
     else
     {
         LoadAssetbundle.LoadPrefabCB loadPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadHpBarCompleteCB);
         PrefabManager.Instance.LoadPrefab("UI/UI_Object/Enemy_Hp_Bar", System.Guid.NewGuid(), loadPrefabCB);
     }
 }
コード例 #3
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
    private IEnumerator InitUI()
    {
        LoadAssetbundle.LoadPrefabCB loadUICompleteCB = null;
        for (int i = 0; i < uiPathArray.Length; i++)
        {
            loadUICompleteCB = new LoadAssetbundle.LoadPrefabCB(LoadUICompleteCB);
            PrefabManager.Instance.LoadPrefab(uiPathArray[i], System.Guid.NewGuid(), loadUICompleteCB, i);

            yield return(null);
        }

        isLoadUIComplete = true;
    }
コード例 #4
0
ファイル: LobbyManager.cs プロジェクト: 1010MMR/Portfolio
    private IEnumerator InitUI()
    {
        LoadAssetbundle.LoadPrefabCB loadUICompleteCB = null;
        for (int i = 0; i < lobbyPanelPathArray.Length; i++)
        {
            if (lobbyPanelPathArray[i].isLoadOnStart)
            {
                loadUICompleteCB = new LoadAssetbundle.LoadPrefabCB(LoadUICompleteCB);
                PrefabManager.Instance.LoadPrefab(lobbyPanelPathArray[i].path, System.Guid.NewGuid(), loadUICompleteCB, lobbyPanelPathArray[i].type);
            }

            yield return(null);
        }
    }
コード例 #5
0
    private void AddFragmentEffect()
    {
        SkeletonEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(eEffectType.Type_Fragment, out effect))
        {
            effect.Init(damageDummy != null ? damageDummy : transform);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEffectCompleteCB);
            PrefabManager.Instance.LoadPrefab(GameManager.Instance.GetCastle.fragmentEffectPath, System.Guid.NewGuid(), loadEffectPrefabCB);
        }
    }
コード例 #6
0
    private void AddCriticalEffect()
    {
        SkeletonEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(eEffectType.Type_Critical, out effect))
        {
            effect.Init(damageDummy != null ? damageDummy : transform);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEffectCompleteCB);
            PrefabManager.Instance.LoadPrefab("Effect/Critical_Effect", System.Guid.NewGuid(), loadEffectPrefabCB);
        }
    }
コード例 #7
0
    public void SetSkillEffect()
    {
        SkeletonEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(eEffectType.Type_Add_Skill_Point, out effect))
        {
            effect.Init(SKILL_GET_POSITION, true);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEffectCompleteCB);
            PrefabManager.Instance.LoadPrefab("Effect/Get_Skill_Effect", System.Guid.NewGuid(), loadEffectPrefabCB, SKILL_GET_POSITION, true);
        }
    }
コード例 #8
0
    public void SetBuffText(string text)
    {
        UIDamageText buffText = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectTextFromPool(out buffText))
        {
            buffText.Init(transform, text);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadBuffTextPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadBuffTextCompleteCB);
            PrefabManager.Instance.LoadPrefab("Effect/Text_Effect", System.Guid.NewGuid(), loadBuffTextPrefabCB, text);
        }
    }
コード例 #9
0
    private IEnumerator Preload()
    {
        // 이펙트
        string[] effectPathArray = { "Effect/Lobby_Touch_Effect" };
        for (int i = 0; i < effectPathArray.Length; i++)
        {
            LoadAssetbundle.LoadPrefabCB loadEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadPreloadEffectCompleteCB);
            PrefabManager.Instance.LoadPrefab(effectPathArray[i], System.Guid.NewGuid(), loadEffectPrefabCB);

            yield return(null);
        }

        StartCoroutine("InitUI");
    }
コード例 #10
0
    private void SetDamageText(int damage, eDamageTextType type)
    {
        UIDamageText damageText = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetDamageTextFromPool(type, out damageText))
        {
            damageText.Init(damageDummy != null ? damageDummy : transform, damage);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadDamageTextPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDamageTextCompleteCB);
            PrefabManager.Instance.LoadPrefab(GameManager.Instance.GetDamagePath(type), System.Guid.NewGuid(), loadDamageTextPrefabCB, damage);
        }
    }
コード例 #11
0
    private void SetDamageText(DamageParam param)
    {
        UIDamageText damageText = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetDamageTextFromPool(out damageText))
        {
            damageText.Init(effectDummy, param);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadDamageTextPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDamageTextCompleteCB);
            PrefabManager.Instance.LoadPrefab("Effect/Text_Damage", System.Guid.NewGuid(), loadDamageTextPrefabCB, param);
        }
    }
コード例 #12
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
    public void MakeEnemy(int level, EnemyTable.TableRow table)
    {
        Enemy enemy = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEnemyFromPool(table.id, out enemy))
        {
            enemy.Init(level, table);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEnemyCompleteCB);
            PrefabManager.Instance.LoadPrefab(table.path, System.Guid.NewGuid(), loadPrefabCB, level, table);
        }
    }
コード例 #13
0
    private void SetTouchEffect(Vector3 touchPos)
    {
        SkeletonEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(eEffectType.Type_Touch, out effect))
        {
            effect.Init(touchPos);
        }
        else
        {
            LoadAssetbundle.LoadPrefabCB loadEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadEffectCompleteCB);
            PrefabManager.Instance.LoadPrefab("Effect/Lobby_Touch_Effect", System.Guid.NewGuid(), loadEffectPrefabCB, touchPos, false);
        }
    }
コード例 #14
0
ファイル: LobbyManager.cs プロジェクト: 1010MMR/Portfolio
    public void OpenShop()
    {
        if (uiShop != null)
        {
            uiShop.OpenFrame();
        }
        else
        {
            int index = GetLobbyPanelPathIndex(eUIType.Type_Shop);

            LoadAssetbundle.LoadPrefabCB loadUICompleteCB = new LoadAssetbundle.LoadPrefabCB(LoadUICompleteCB);
            PrefabManager.Instance.LoadPrefab(lobbyPanelPathArray[index].path,
                                              System.Guid.NewGuid(), loadUICompleteCB, eUIType.Type_Shop, true);
        }
    }
コード例 #15
0
ファイル: Hero.cs プロジェクト: 1010MMR/Portfolio
 private void LoadAttackEffect(Transform target, SpriteEffect.EffectCompleteCB effectCompleteCB)
 {
     if (status.GetEffectTable != null)
     {
         SpriteEffect effect = null;
         if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(status.GetEffectTable.id, out effect))
         {
             effect.Init(target, effectCompleteCB);
         }
         else
         {
             LoadAssetbundle.LoadPrefabCB loadEffectCB = new LoadAssetbundle.LoadPrefabCB(LoadAttackEffectCompleteCB);
             PrefabManager.Instance.LoadPrefab(status.GetEffectTable.effectPath, System.Guid.NewGuid(),
                                               loadEffectCB, target, status.GetEffectTable, effectCompleteCB);
         }
     }
 }
コード例 #16
0
    private void SetDamageEffect(DamageParam param)
    {
        SpriteEffect effect = null;

        if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(param.GetDamageEffectID, out effect))
        {
            effect.Init(effectDummy);
        }
        else
        {
            EffectTable.TableRow effectTable = null;
            if (EffectTable.Instance.FindTable(param.GetDamageEffectID, out effectTable))
            {
                LoadAssetbundle.LoadPrefabCB loadDamageEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDamageEffectCompleteCB);
                PrefabManager.Instance.LoadPrefab(effectTable.effectPath, System.Guid.NewGuid(), loadDamageEffectPrefabCB, effectTable);
            }
        }
    }
コード例 #17
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);
        }
    }
コード例 #18
0
    private IEnumerator InitUI()
    {
        lobbyTabGroup = new LobbyState[(int)eUILobbyTab.Type_End];

        LoadAssetbundle.LoadPrefabCB loadUICompleteCB = null;
        for (int i = 0; i < lobbyPanelPathArray.Length; i++)
        {
            if (lobbyPanelPathArray[i].isLoadOnStart)
            {
                loadUICompleteCB = new LoadAssetbundle.LoadPrefabCB(LoadUICompleteCB);
                PrefabManager.Instance.LoadPrefab(lobbyPanelPathArray[i].path, System.Guid.NewGuid(), loadUICompleteCB, lobbyPanelPathArray[i].type);
            }

            yield return(null);
        }

        if (uiLobby != null)
        {
            uiLobby.OpenFrame();
        }
    }
コード例 #19
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
    private IEnumerator Preload()
    {
        // 이펙트
        List <EffectTable.TableRow> effectTable = null;

        if (EffectTable.Instance != null && EffectTable.Instance.GetTable(out effectTable))
        {
            for (int i = 0; i < effectTable.Count; i++)
            {
                LoadAssetbundle.LoadPrefabCB loadDamageEffectPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDamageEffectCompleteCB);
                PrefabManager.Instance.LoadPrefab(effectTable[i].effectPath, System.Guid.NewGuid(), loadDamageEffectPrefabCB, effectTable[i]);

                yield return(null);
            }
        }

        // 텍스트
        LoadAssetbundle.LoadPrefabCB loadDamageTextPrefabCB = new LoadAssetbundle.LoadPrefabCB(LoadDamageTextCompleteCB);
        PrefabManager.Instance.LoadPrefab("Effect/Text_Damage", System.Guid.NewGuid(), loadDamageTextPrefabCB);

        StartCoroutine("InitUI");
    }
コード例 #20
0
ファイル: Hero.cs プロジェクト: 1010MMR/Portfolio
 private void LoadAttackEffect()
 {
     if (status.GetEffectTable != null)
     {
         SpriteEffect effect = null;
         for (int i = 0; i < weaponEffectDummyArray.Length; i++)
         {
             if (weaponEffectDummyArray[i].activeInHierarchy)
             {
                 if (PoolManager.Instance != null && PoolManager.Instance.GetEffectFromPool(status.GetEffectTable.id, out effect))
                 {
                     SetAttackEffect(effect, weaponEffectDummyArray[i].transform);
                 }
                 else
                 {
                     LoadAssetbundle.LoadPrefabCB loadEffectCB = new LoadAssetbundle.LoadPrefabCB(LoadAttackEffectCompleteCB);
                     PrefabManager.Instance.LoadPrefab(status.GetEffectTable.effectPath, System.Guid.NewGuid(),
                                                       loadEffectCB, weaponEffectDummyArray[i].transform, status.GetEffectTable);
                 }
             }
         }
     }
 }
コード例 #21
0
ファイル: GameManager.cs プロジェクト: 1010MMR/Portfolio
 public void SetCameraFade(SupportUtil.CameraFadeCB fadeCB, params object[] param)
 {
     LoadAssetbundle.LoadPrefabCB loadUICompleteCB = new LoadAssetbundle.LoadPrefabCB(LoadCameraFadeCompleteCB);
     PrefabManager.Instance.LoadPrefab("Object/CameraFade", System.Guid.NewGuid(), loadUICompleteCB, fadeCB, param);
 }