Пример #1
0
    public void SetInfo(Vector3 dest, DoAttackFun fun, float speed, WalkDir dir, BulletType t, SoldierSkill skill, bool isPlaySound = true)
    {
        m_dir           = dir;
        m_Skill         = false;
        m_skillinfo     = skill;
        m_Start         = transform.localPosition;
        m_Start.z       = -0.5f;
        m_Destination   = dest;
        m_Destination.z = -0.5f;
        //m_Destination.y = m_Start.y;
        m_fun      = fun;
        m_Speed    = speed;
        m_Duration = Mathf.Abs(transform.localPosition.x - m_Destination.x) / speed;
        m_type     = t;
        //effect = SkillEffects._instance.LoadEffect("effect/prefab/", "1002011",transform.position,0.5f);



        if (isPlaySound)
        {
            SoundPlay.Play("fireGun", false, false);
        }
        m_info = m_skillinfo.m_skilleffectinfo;

        /*if (t == BulletType.Grenade || t == BulletType.Snowball|| t == BulletType.Poison || t == BulletType.ling)
         * {
         *      //m_Destination.y -= 1f;
         *      myBezier = new Bezier( m_Start,  new Vector3(0,-3,0),  new Vector3(0,-3,0), m_Destination );
         * }
         *
         * if (t == BulletType.Grenade || t == BulletType.Snowball|| t == BulletType.Poison )
         * {
         *      //m_Destination.y -= 1f;
         *      myBezier = new Bezier( m_Start,  new Vector3(0,-3,0),  new Vector3(0,-3,0), m_Destination );
         * }
         * if (t == BulletType.ling)
         * {
         *      //m_Destination.y -= 1f;
         *      m_Destination.y = m_Start.y;
         *      myBezier = new Bezier( m_Start,  new Vector3(0,-2,0),  new Vector3(0,-2,0), m_Destination );
         * }*/

        if (skill.m_type == 1005)
        {
            float   dis = m_Destination.x - m_Start.x;
            Vector3 pos = m_Destination;
            pos.x    = m_Start.x + dis * 0.7f;
            myBezier = new Bezier(m_Start, new Vector3(0, -m_info.m_locus, 0), new Vector3(0, -m_info.m_locus, 0), pos);
            Vector3 pos1 = pos;
            pos1.x   += dis * 0.2f;
            myBezier1 = new Bezier(pos, new Vector3(0, -m_info.m_locus * 0.4f, 0), new Vector3(0, -m_info.m_locus * 0.4f, 0), pos1);
            myBezier2 = new Bezier(pos1, new Vector3(0, -m_info.m_locus * 0.2f, 0), new Vector3(0, -m_info.m_locus * 0.2f, 0), m_Destination);
        }
        else
        {
            myBezier = new Bezier(m_Start, new Vector3(0, -m_info.m_locus, 0), new Vector3(0, -m_info.m_locus, 0), m_Destination);
        }

        //Debug.Log("bullet:" + transform.localPosition + ","  +m_Destination + "," + m_Speed + "," + m_Duration + ","+Mathf.Abs(transform.localPosition.x - m_Destination.x));
    }
Пример #2
0
    /// param:Id[对应到SkillSceneObjManager中的SkillEffectId]
    /// example:2
    public void Trigger_PlayEffectAtRoleByEffectId(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_PlayEffectAtRoleByEffectId param:" + param);
#endif
        SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param);
        if (m_SceneObjMgr != null)
        {
            SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id);
            if (effectInfo != null)
            {
                effectInfo = effectInfo.Clone();
                Vector3 pos = this.gameObject.transform.position;
                Vector3 rot = this.gameObject.transform.rotation.eulerAngles;
                if (!string.IsNullOrEmpty(effectInfo.EffectParentBone))
                {
                    Transform t = LogicSystem.FindChildRecursive(this.gameObject.transform, effectInfo.EffectParentBone);
                    if (null != t)
                    {
                        pos = t.position;
                    }
                }
                effectInfo.EffectPos += pos;
                effectInfo.EffectRot += rot;
                TriggerImpl.PlayEffect(effectInfo);
            }
        }
    }
Пример #3
0
    /// param:Id[对应到SkillSceneObjManager中的SkillEffectId]
    /// example:2
    public void Trigger_PlayEffectAtWeaponByEffectId(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_PlayEffectAtWeaponByEffectId param:" + param);
#endif
        SkillSceneObjInfo sobjInfo      = new SkillSceneObjInfo(param);
        MasterWeaponType  masterType    = (MasterWeaponType)(sobjInfo.ExtractNumeric <int>(0, 0));
        GameObject        curMainWeapon = TriggerImpl.GetCurMainWeapon(this.gameObject, masterType);
        if (m_SceneObjMgr != null && curMainWeapon != null)
        {
            SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id);
            if (effectInfo != null)
            {
                effectInfo = effectInfo.Clone();
                Vector3 pos = curMainWeapon.transform.position;
                Vector3 rot = curMainWeapon.transform.rotation.eulerAngles;
                if (!string.IsNullOrEmpty(effectInfo.EffectParentBone))
                {
                    Transform t = LogicSystem.FindChildRecursive(curMainWeapon.transform, effectInfo.EffectParentBone);
                    if (null != t)
                    {
                        pos = t.position;
                    }
                }
                effectInfo.EffectPos += pos;
                effectInfo.EffectRot += rot;
                TriggerImpl.PlayEffect(effectInfo);
            }
        }
    }
Пример #4
0
    public void OnGestureResult(string GestureClass)
    {
        int             skillcount   = skillEffectSystem.SkillEffectList.Count;
        GameObject      pSkillEffect = null;
        SkillEffectInfo effectInfo   = null;
        bool            applySkill   = true;
        string          skillName    = null;

        for (int i = 0; i < skillcount; ++i)
        {
            //표식 검사전 스킬정보에 대해 검사
            if (skillEffectSystem.SkillEffectList[i].sign == GestureClass)
            {
                skillName    = GestureClass;
                effectInfo   = skillEffectSystem.SkillEffectList[i];
                pSkillEffect = skillEffectSystem.SkillEffectList[i].skillEffect;
                applySkill   = effectInfo.GetIsUse();
                break;
            }
        }
        if (applySkill == true)
        {
            for (int i = zombieList.Count - 1; i >= 0; i--)
            {
                //스킬 적용
                for (int j = zombieList[i].transform.GetComponent <EnemyAI>().SignList.Count - 1; j >= 0; j--)
                {
                    //일반스킬일 경우
                    bool isRemove = zombieList[i].transform.GetComponent <EnemyAI>().SignList[j].transform.GetComponent <SignInfo>().remove;
                    if (isRemove == false)
                    {
                        string sign = zombieList[i].transform.GetComponent <EnemyAI>().SignList[j].transform.GetComponent <SignInfo>().sign;
                        if (sign == GestureClass)
                        {
                            SkillInfo skillInfo = new SkillInfo();
                            skillInfo.ApplySkill = pSkillEffect;
                            skillInfo.skillName  = skillName;
                            skillInfo.target     = zombieList[i];
                            skillInfo.signList.Add(zombieList[i].transform.GetComponent <EnemyAI>().SignList[j].transform.GetComponent <SignInfo>().gameObject);
                            skillInfo.effectInfo = effectInfo;
                            skillInfo.magicType  = SkillInfo.MagicType.NORMAL;
                            zombieList[i].transform.GetComponent <EnemyAI>().appliedSkillList.Add(skillInfo);
                            zombieList[i].transform.GetComponent <EnemyAI>().SignList[j].transform.GetComponent <SignInfo>().remove = true;
                            Wizard.GetComponent <WizardMove>().Move(zombieList[i]);
                            checkSignList.Add(zombieList[i].GetComponent <EnemyAI>().SignList[j]);
                            //gameObject.GetComponent<ExperimentModule>().Add_CorrectCount(sign);
                        }
                    }
                }
            }
            CameraMoveBySituation(skillName);
            CheckGetEnemyScore();
        }
        Wizard.GetComponent <WizardMove>().resetMaxDistance();
        checkSignList.Clear();
    }
Пример #5
0
    /// <summary>
    /// Triggers
    /// </summary>
    /// param:Id[对应到SkillSceneObjManager中的SkillEffectId]
    /// example:2
    public void Trigger_PlayEffectAtPosByEffectId(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_PlayEffectByEffectId param:" + param);
#endif
        SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param);
        if (m_SceneObjMgr != null)
        {
            SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id);
            if (effectInfo != null)
            {
                TriggerImpl.PlayEffect(effectInfo);
            }
        }
    }
Пример #6
0
    public SkillEffectInfo Clone()
    {
        SkillEffectInfo newData = new SkillEffectInfo();

        newData.Id               = Id;
        newData.IsValid          = IsValid;
        newData.EffectName       = EffectName;
        newData.EffectAsset      = EffectAsset;
        newData.EffectLiftTime   = EffectLiftTime;
        newData.EffectPos        = EffectPos;
        newData.EffectRot        = EffectRot;
        newData.EffectParentBone = EffectParentBone;
        newData.EffectParent     = EffectParent;
        newData.EffectSoundId    = EffectSoundId;
        return(newData);
    }
Пример #7
0
 /// <summary>
 /// 设置技能特效
 /// </summary>
 private static void  SetSkillEffect(s_skilleffectInfo e, ref SkillEffectInfo Info)
 {
     if (e == null)
     {
         return;
     }
     if (Info == null)
     {
         Info = new SkillEffectInfo();
     }
     Info.m_id           = e.id;
     Info.m_skilltype    = e.skilltype;
     Info.m_hiteffect    = e.hiteffect;
     Info.m_targeteffect = e.targeteffect;
     Info.m_locus        = e.locus;
     Info.m_hitaudio     = e.hitaudio;
     Info.m_isloop       = e.isloop;
     Info.m_postion      = e.position;
 }
Пример #8
0
    private void CreateTargetGuilde(Vector3 targetPos)
    {
        if (m_SceneObjMgr == null)
        {
            Debug.Log("ShooterSkillLogic_ExShoot CreateTargetGuilde m_SceneObjMgr miss!");
            return;
        }
        SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(TargetPosGuildEffectId);

        if (effectInfo != null)
        {
            effectInfo.EffectPos = TargetPos + new Vector3(0, 0.2f, 0);
            effectInfo.EffectRot = Vector3.zero;
            if (effectInfo != null)
            {
                TriggerImpl.PlayEffect(effectInfo);
            }
        }
    }
Пример #9
0
    public void SetInfo(Vector3 dest, SkillUseFun fun, float speed, WalkDir dir, SoldierSkill skill, LifeMCamp camp, int layer, bool isPlaySound = true)
    {
        m_dir           = dir;
        m_Skill         = false;
        m_skillinfo     = skill;
        m_Start         = transform.localPosition;
        m_Start.z       = -0.5f;
        m_Destination   = dest;
        m_Destination.z = -0.5f;
        //m_Destination.y = m_Start.y;
        m_fun      = fun;
        m_Speed    = speed;
        m_Duration = Mathf.Abs(transform.localPosition.x - m_Destination.x) / speed;
        //effect = SkillEffects._instance.LoadEffect("effect/prefab/", "1002011",transform.position,0.5f);
        m_camp  = camp;
        m_info  = m_skillinfo.m_skilleffectinfo;
        m_layer = layer;

        //Debug.Log("bullet:" + transform.localPosition + ","  +m_Destination + "," + m_Speed + "," + m_Duration + ","+Mathf.Abs(transform.localPosition.x - m_Destination.x));
    }
Пример #10
0
    /// param:Id[对应到SkillSceneObjManager中的SkillEffect Id]
    /// example:2
    public void Trigger_AttachEffectDirectAtRoleByEffectId(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_AttachEffectDirectAtRoleByEffectId param:" + param);
#endif
        SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param);
        if (m_SceneObjMgr != null)
        {
            SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id);
            if (effectInfo != null)
            {
                effectInfo = effectInfo.Clone();
                effectInfo.EffectParent = this.gameObject.transform;
                TriggerImpl.AttachEffectDirect(effectInfo);
            }
        }
        else
        {
            Debug.Log("Trigger_AttachEffectDirectAtRoleByEffectId null");
        }
    }
Пример #11
0
    /// param:Id[对应到SkillSceneObjManager中的SkillEffectId]
    /// example:2
    public void Trigger_AttachEffectAtWeaponByEffectId(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_AttachEffectAtWeaponByEffectId param:" + param);
#endif
        SkillSceneObjInfo sobjInfo      = new SkillSceneObjInfo(param);
        MasterWeaponType  masterType    = (MasterWeaponType)(sobjInfo.ExtractNumeric <int>(0, 0));
        GameObject        curMainWeapon = TriggerImpl.GetCurMainWeapon(this.gameObject, masterType);
        if (m_SceneObjMgr != null && curMainWeapon != null)
        {
            SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id);
            if (effectInfo != null)
            {
                effectInfo = effectInfo.Clone();
                effectInfo.EffectParent = curMainWeapon.transform;
                TriggerImpl.AttachEffect(effectInfo);
            }
        }
        else
        {
            Debug.Log("Trigger_AttachEffectAtWeaponByEffectId null");
        }
    }
Пример #12
0
    //////////////////////////////////////////////////////////////////////////
    // Effect
    public static GameObject PlayEffect(SkillEffectInfo info)
    {
        GameObject tEffectObj = null;

        if (info.EffectAsset != null)
        {
            tEffectObj = Script_Util.CreateGameObjectByAsset(info.EffectAsset);
        }
        else
        {
            tEffectObj = Script_Util.CreateGameObjectByName(info.EffectName);
        }

        if (tEffectObj != null)
        {
            tEffectObj.transform.rotation = Quaternion.Euler(info.EffectRot);
            tEffectObj.transform.position = info.EffectPos;
            if (tEffectObj.particleSystem != null)
            {
                tEffectObj.particleSystem.Play(true);
            }
            if (OnGetSkillSoundInfo != null)
            {
                SkillSoundInfo sInfo = OnGetSkillSoundInfo(info.EffectSoundId);
                if (sInfo != null)
                {
                    TriggerImpl.PlaySoundAtTarget(tEffectObj, sInfo);
                }
            }
            GameObject.Destroy(tEffectObj, Script_Util.ForceNotifyEffectTime(info.EffectLiftTime));
        }
        else
        {
            LogicSystem.GfxLog("PlayEffect create failed!");
        }
        return(tEffectObj);
    }
Пример #13
0
    public static GameObject AttachEffectDirect(SkillEffectInfo info)
    {
        GameObject tEffectObj = null;

        if (info.EffectAsset != null)
        {
            tEffectObj = Script_Util.CreateGameObjectByAsset(info.EffectAsset);
        }
        else
        {
            tEffectObj = Script_Util.CreateGameObjectByName(info.EffectName);
        }
        if (null != tEffectObj)
        {
            bool ret = Script_Util.AttachGameObjectDirect(info.EffectParent, tEffectObj.transform);
            if (ret)
            {
                tEffectObj.transform.localPosition = info.EffectPos;
                tEffectObj.transform.localRotation = Quaternion.Euler(info.EffectRot);
            }
            if (OnGetSkillSoundInfo != null)
            {
                SkillSoundInfo sInfo = OnGetSkillSoundInfo(info.EffectSoundId);
                if (sInfo != null)
                {
                    TriggerImpl.PlaySoundAtTarget(tEffectObj, sInfo);
                }
            }
            GameObject.Destroy(tEffectObj, Script_Util.ForceNotifyEffectTime(info.EffectLiftTime));
        }
        else
        {
            LogicSystem.GfxLog("AttachEffect effect create failed!");
        }
        return(tEffectObj);
    }
Пример #14
0
    public SkillEffectInfo GetSkillEffectInfo(uint id)
    {
        SkillEffectInfo info;

        if (mSkillEffectMap.TryGetValue(id, out info))
        {
            return(info);
        }

        string query_str    = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "id", id.ToString());
        var    table_reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query_str);

        if (table_reader == null)
        {
            mSkillEffectMap[id] = null;
            return(null);
        }

        if (!table_reader.HasRows)
        {
            mSkillEffectMap[id] = null;
            table_reader.Close();
            table_reader.Dispose();
            return(null);
        }

        if (!table_reader.Read())
        {
            mSkillEffectMap[id] = null;
            table_reader.Close();
            table_reader.Dispose();
            return(null);
        }

        info      = new SkillEffectInfo();
        info.id   = DBTextResource.ParseUI(GetReaderString(table_reader, "id"));
        info.type = GetReaderString(table_reader, "type");
        info.attr = GetReaderString(table_reader, "attr");
        float.TryParse(GetReaderString(table_reader, "p1"), out info.p1);
        string p2_str    = GetReaderString(table_reader, "p2");
        float  p         = 0;
        bool   can_parse = float.TryParse(p2_str, out p);

        if (can_parse == false)
        {
            //尝试用潜力格式读取
            List <uint> p2_array = DBTextResource.ParseArrayUint(p2_str, ",");
            if (p2_array != null && p2_array.Count >= 2)
            {
                info.p2_potentialParam = new SkillEffectInfo.SkillEffectInfoPotentialParam();
                info.p2_potentialParam.trigram_rune_id = p2_array[0];
                info.p2_potentialParam.value           = p2_array[1];
            }
        }
        else
        {
            info.p2 = p;
        }

        mSkillEffectMap[info.id] = info;

        table_reader.Close();
        table_reader.Dispose();

        return(info);
    }