示例#1
0
    private GameObject CreateNewWeapon(SkillWeaponInfo info)
    {
        GameObject tWeaponObj = null;

        if (info.WeaponAsset != null)
        {
            tWeaponObj = Script_Util.CreateGameObjectByAsset(info.WeaponAsset);
        }
        else
        {
            tWeaponObj = Script_Util.CreateGameObjectByName(info.WeaponName);
        }
        return(tWeaponObj);
    }
示例#2
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);
    }
示例#3
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);
    }