public void ShowTargetFx(int changedInstId)
    {
        // 타겟이 변경 되었거나 내 캐릭터의 타겟 정보만 처리한다
        if (Owner.TargetID == changedInstId)
        {
            return;
        }

        // despawn Fx
        if (null != TargetingEffect)
        {
            SelfDespawn.ClearPartileSystem(TargetingEffect);
            G_GameInfo.EffectPool.Despawn(TargetingEffect, G_GameInfo.EffectPool.group);
            TargetingEffect = null;
        }

        Unit Target = null;

        if (!G_GameInfo.CharacterMgr.InvalidTarget(changedInstId, ref Target))
        {
            TargetingEffect = G_GameInfo.SpawnEffect("Fx_Targeting", 1f, Target.transform, Target.transform, Owner.Model.ScaleVec3);
            if (TargetingEffect.gameObject.layer != 0)
            {
                NGUITools.SetChildLayer(TargetingEffect, 0);
            }
        }
    }
예제 #2
0
    //float RunTime = 0;

    public override void OnEnter(System.Action callback)
    {
        base.OnEnter(callback);

        //< 내가 사용했던 모든 이펙트 삭제
        //parent.EffectClear();
        parent.PlayAnim(eAnimName.Anim_intro);
        parent.Animator.PlayAnimationSound(eAnimName.Anim_intro);
        string effName = parent.Animator.GetAnimationEffect(eAnimName.Anim_intro);

        if (!string.IsNullOrEmpty(effName))
        {
            G_GameInfo.SpawnEffect(effName, parent.cachedTransform.position, Quaternion.Euler(parent.cachedTransform.eulerAngles));
        }

        AniPlayTime = parent.Animator.GetAnimLength(eAnimName.Anim_intro);
    }
예제 #3
0
    public void FootEvent()
    {
        if (MyUnit == null)
        {
            return;
        }

        if (MyUnit.CurrentState != UnitState.Move)
        {
            return;
        }

        string effName = MyUnit.Animator.GetAnimationEffect(MyUnit.Animator.CurrentAnim);

        if (string.IsNullOrEmpty(effName))
        {
            effName = "Fx_pc_moving_effect";
        }

        if (!effName.Equals("0"))
        {
            if (TownState.TownActive)
            {
                uint soundID = MyUnit.Animator.GetAnimationSound(MyUnit.Animator.CurrentAnim);

                if (soundID != 0)
                {
                    SoundManager.instance.PlaySfxUnitSound(soundID, MyUnit._audioSource, MyUnit.cachedTransform, true);
                }

                TownState.SpawnEffect(effName, MyUnit.cachedTransform.position, Quaternion.Euler(Vector3.zero));
            }
            else
            {
                uint soundID = MyUnit.Animator.GetAnimationSound(MyUnit.Animator.CurrentAnim);

                if (soundID != 0)
                {
                    SoundManager.instance.PlaySfxUnitSound(soundID, MyUnit._audioSource, MyUnit.cachedTransform);
                }

                G_GameInfo.SpawnEffect(effName, MyUnit.cachedTransform.position, Quaternion.Euler(Vector3.zero));
            }
        }
    }
 void SpawnEffect(CutSceneEventDataList data)
 {
     if (data.ActionValue != -1)
     {
         G_GameInfo.SpawnEffect(data.ActionString, 1f, CutSceneMgr.CutSceneEventDic[(int)data.ActionValue].transform, CutSceneMgr.CutSceneEventDic[(int)data.ActionValue].transform, Vector3.one, (efftrn) =>
         {
             efftrn.localPosition = data.ActionPos;
             CutSceneMgr.EffectList.Add(efftrn.gameObject);
         });
     }
     else
     {
         G_GameInfo.SpawnEffect(data.ActionString, 1f, null, null, Vector3.one, (efftrn) =>
         {
             efftrn.localPosition = data.ActionPos;
             CutSceneMgr.EffectList.Add(efftrn.gameObject);
         });
     }
 }
예제 #5
0
    //< 소환되어진 유닛이 있다면 파괴하기위함
    public void DeleteUnit()
    {
        if (UnitList == null)
        {
            return;
        }

        for (int i = 0; i < UnitList.Count; i++)
        {
            if (UnitList[i] != null)
            {
                UnitList[i].EffectClear(true);
                G_GameInfo.SpawnEffect("Fx_Monster_RegenEnd_01", UnitList[i].transform.position, Quaternion.identity);
                G_GameInfo.CharacterMgr.RemoveUnit(UnitList[i]);
                TempCoroutine.Destroy(UnitList[i].gameObject);
            }
        }

        UnitList.Clear();
    }
예제 #6
0
    public void GetProjectTile(string fileName, System.Action <GameObject> call, bool _Save = false)
    {
        if (ProjectTileDic.ContainsKey(fileName))
        {
            //< 있으면 바로 보내줌
            call(ProjectTileDic[fileName]);
        }
        else
        {
            GameObject temp = G_GameInfo.ProtoTypeProjectileGenerator(fileName);

            if (!ProjectTileDic.ContainsKey(fileName))
            {
                ProjectTileDic.Add(fileName, temp);
            }
            call(ProjectTileDic[fileName]);

            ////< 없다면 아예 그룹자체를 로드후에 실행한다
            //foreach (KeyValuePair<string, List<string>> dic in ProjectTileJsonDic)
            //        {
            //            List<string> list = dic.Value;
            //            for (int i = 0; i < list.Count; i++)
            //            {
            //                if (list[i] == fileName)
            //                {
            //                    new Task(LocalLoadProjectTile(dic.Key, () =>
            //                    {
            //                        GetProjectTile(fileName, call, _Save);
            //                    }, _Save));

            //                    return;
            //                }
            //            }
            //        }
        }
    }
예제 #7
0
    //< 프리팹 모델 생성
    void CreateModel()
    {
        //발사체 풀에서 모델링 로더 하도록 수정 해야함
        if (ModelObj == null)
        {
            G_GameInfo.SpawnProjectTile(projectileInfo.prefab, transform, (tileobj) =>
            {
                bNetInit = true;

                ModelObj = tileobj;
                if (ModelObj != null)
                {
                    ModelObj.gameObject.SetActive(true);
                }

                //< 사운드 생성
                if (projectileInfo.ProjectSound != 0)
                {
                    //SoundHelper.PlaySfxSound(projectileInfo.ProjectSound, 1);
                    SoundManager.instance.PlaySfxSound(projectileInfo.ProjectSound);
                }
            });
        }
    }
예제 #8
0
    static IEnumerator SpawnPrefab(string prefabName, Transform _from, Transform _target, float delay, DropType dtype, float gold, bool boss = false)
    {
        yield return(new WaitForSeconds(delay));

        Debug.Log(prefabName + "  " + _from.name);
        GameObject coinTrans = G_GameInfo.SpawnInGameObj(prefabName, _from.transform.position, _from.transform.localRotation);

        if (coinTrans == null)
        {
            yield break;
        }

        Debug.Log(prefabName + "  " + _from.name);

        Transform trGbox = coinTrans.transform.FindChild("GoldBox_001");
        Transform trWbox = coinTrans.transform.FindChild("woodbox_001");
        Transform trCoin = coinTrans.transform.FindChild("coin");

        switch (dtype)
        {
        case DropType.treasureChest:
            if (trGbox != null)
            {
                trGbox.gameObject.SetActive(true);
            }
            if (trWbox != null)
            {
                trWbox.gameObject.SetActive(false);
            }
            if (trCoin != null)
            {
                trCoin.gameObject.SetActive(false);
            }
            break;

        case DropType.WoodBox:
            if (trGbox != null)
            {
                trGbox.gameObject.SetActive(false);
            }
            if (trWbox != null)
            {
                trWbox.gameObject.SetActive(true);
            }
            if (trCoin != null)
            {
                trCoin.gameObject.SetActive(false);
            }
            break;

        case DropType.Exp:

            break;

        case DropType.Gold:
        default:
            if (trGbox != null)
            {
                trGbox.gameObject.SetActive(false);
            }
            if (trWbox != null)
            {
                trWbox.gameObject.SetActive(false);
            }
            if (trCoin != null)
            {
                trCoin.gameObject.SetActive(true);
            }
            //SoundManager.instance.PlaySfxSound(eUISfx.DropGold, false);
            break;
        }

        float   itemAdd    = dtype != DropType.Gold ? 3 : 0;
        Vector3 spawnedPos = coinTrans.transform.position;
        Vector3 addPos     = Random.insideUnitSphere * (float)Random.Range(0 + itemAdd, 2 + itemAdd);

        addPos.y = 0;
        coinTrans.transform.position = spawnedPos + addPos;

        //< 각도를 랜덤으로 잡아줌
        coinTrans.transform.localRotation = Quaternion.Euler(new Vector3(0, Random.Range(0, 360), 0));

        if (dtype == DropType.Gold)
        {
            //< 사이즈 조금더 보정해줌
            coinTrans.transform.localScale = Vector3.one * 1.2f;
        }
        else
        {
            coinTrans.transform.localScale = Vector3.one * 0.4f;
        }

        TweenAsset asset = coinTrans.GetComponent <TweenAsset>();

        if (asset != null)
        {
            asset.StartTween(_target, boss, gold, dtype);
        }
    }