Пример #1
0
    public static void StartLockFrame(GameObject target, SkillLockFrameInfo info)
    {
        SkillLockFrame tLockFrame = target.gameObject.GetComponent <SkillLockFrame>();

        if (tLockFrame == null)
        {
            LogicSystem.GfxLog("Trigger_LockFrame component miss!");
            return;
        }
        tLockFrame.StartLockFrame(info);
    }
Пример #2
0
    public SkillLockFrameInfo Clone()
    {
        SkillLockFrameInfo newData = new SkillLockFrameInfo();

        newData.IsValid        = IsValid;
        newData.Id             = Id;
        newData.AnimName       = AnimName;
        newData.AnimAsset      = AnimAsset;
        newData.Duration       = Duration;
        newData.AnimSpeed      = AnimSpeed;
        newData.AnimSpeedReset = AnimSpeedReset;
        newData.AnimUseCurve   = AnimUseCurve;
        newData.AnimSpeedCurve = AnimSpeedCurve;
        newData.NeedTarget     = NeedTarget;
        return(newData);
    }
Пример #3
0
 public void StartLockFrame(SkillLockFrameInfo info)
 {
     m_Info    = info;
     m_Elapsed = 0;
     if (m_Info.AnimAsset != null)
     {
         m_Info.AnimName = m_Info.AnimAsset.name;
     }
     if (CheckInfoValid())
     {
         float curSpeed = m_Info.AnimSpeed;
         if (m_Info.AnimUseCurve && m_Info.AnimSpeedCurve != null)
         {
             curSpeed = m_Info.AnimSpeedCurve.Evaluate(0);
         }
         SetAnimSpeed(curSpeed);
     }
 }
Пример #4
0
    /// param:ID[对应到SkillSceneObjManager中的LockFrameInfo Id]
    /// example:101
    public void Trigger_LockFrame(string param)
    {
#if SHOOTER_LOG
        Debug.Log("Trigger_LockFrame param:");
#endif
        if (m_SceneObjMgr != null)
        {
            SkillSceneObjInfo  sobjInfo = new SkillSceneObjInfo(param);
            SkillLockFrameInfo lockInfo = m_SceneObjMgr.TryGetSkillLockFrameInfo(sobjInfo.Id);
            if (lockInfo != null)
            {
                lockInfo = lockInfo.Clone();
                TriggerImpl.StartLockFrame(this.gameObject, lockInfo);
            }
            else
            {
                Debug.Log("Trigger_LockFrame null!");
            }
        }
    }
Пример #5
0
    private static void ProcessImpactLock(GameObject attacker, SkillImpactInfos impacts, bool isTargeted)
    {
        SkillLockFrameInfo lockInfo = TriggerImpl.GetLockFrameInfoById(attacker, impacts.LockFrameInfoId);

        if (lockInfo != null)
        {
            lockInfo = lockInfo.Clone();
            if (lockInfo.NeedTarget)
            {
                if (isTargeted)
                {
                    TriggerImpl.StartLockFrame(attacker, lockInfo);
                }
            }
            else
            {
                TriggerImpl.StartLockFrame(attacker, lockInfo);
            }
        }

        SkillMoveScaleInfo lockMoveInfo = TriggerImpl.GetMoveScaleInfoById(attacker, impacts.MoveScaleInfoId);

        if (lockMoveInfo != null)
        {
            lockMoveInfo = lockMoveInfo.Clone();
            if (lockInfo.NeedTarget)
            {
                if (isTargeted)
                {
                    TriggerImpl.StartMoveScale(attacker, lockMoveInfo);
                }
            }
            else
            {
                lockMoveInfo = lockMoveInfo.Clone();
                TriggerImpl.StartMoveScale(attacker, lockMoveInfo);
            }
        }
    }
Пример #6
0
 internal void Update()
 {
     if (CheckInfoValid())
     {
         m_Elapsed += Time.deltaTime;
         if (m_Info.AnimUseCurve && m_Info.AnimSpeedCurve != null && m_Info.Duration > 0)
         {
             float percent  = Mathf.Min(m_Elapsed / m_Info.Duration, 1.0f);
             float curSpeed = m_Info.AnimSpeedCurve.Evaluate(percent);
             SetAnimSpeed(curSpeed);
         }
         if (m_Elapsed > m_Info.Duration)
         {
             SetAnimSpeed(m_Info.AnimSpeedReset);
         }
     }
     else
     {
         m_Elapsed = 0;
         m_Info    = null;
     }
 }