示例#1
0
    private void HoldWeapon(WeaponHand type, SkillWeaponInfo info)
    {
        GameObject newWeapon = CreateNewWeapon(info);

        if (newWeapon != null)
        {
#if SHOOTER_LOG
            Debug.Log("HoldWeapon:" + newWeapon.name);
#endif
            m_Weapons.Add(info.HoldType, newWeapon);
            Script_Util.AttachGameObject(this.gameObject, newWeapon, GetBoneName(info.HoldType));
        }
    }
示例#2
0
    public static GameObject AttachEffect(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.AttachGameObject(info.EffectParent, tEffectObj.transform, Script_Util.ForceNotifyEffectBone(info.EffectParentBone));
            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);
    }