Exemple #1
0
    /*void OnTriggerEnter(Collider other)
     * {
     * if (!ActorTargetManager.IsTrigger(other))
     * {
     *  return;
     * }
     * //Debug.LogWarning(gameObject.name + " trigger with " + other);
     *      ActorProp selfProp = transform.parent.GetComponent<ActorProp>();
     *      if (null == selfProp)
     *      {
     *  Debug.LogWarning("trigger return, actorProp get failed");
     *              return;
     *      }
     * GlobalEnvironment.Singleton.IsInCallbackOrTrigger = true;
     * try
     * {
     *  Actor self = selfProp.ActorLogicObj;
     *  if (null != self && !self.IsDead)
     *  {
     *      AttackAction action = self.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
     *      if (null != action)
     *      {
     *          action.OnTriggerEnter(gameObject, other);
     *      }
     *      else
     *      {
     *          AttackingMoveAction amAction = self.ActionControl.LookupAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
     *          if (amAction != null)
     *          {
     *              amAction.OnTriggerEnter(gameObject, other);
     *          }
     *      }
     *  }
     * }
     * catch (Exception e)
     * {
     *  Debug.LogError("Error On OnTriggerEnter" + e.Message + ",,,,Stack:" + e.StackTrace.ToString());
     *  DebugLog.Singleton.OnShowLog("[AttackActionCallback Error On OnTriggerEnter] " + e.Message + " " + e.StackTrace.ToString());
     * }
     * GlobalEnvironment.Singleton.IsInCallbackOrTrigger = false;
     * }*/
    void ChangeInstantResultID(AnimationEvent animEvent)
    {
        ActorProp selfProp = transform.parent.GetComponent <ActorProp>();

        if (null == selfProp)
        {
            return;
        }
        Actor self = selfProp.ActorLogicObj;

        if (null != self && !self.IsDead)
        {
            AttackAction action = self.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
            if (null != action)
            {
                ++action.m_skillResultIDIndex;
                action.CreateSkillResult();
            }
            else
            {
                AttackingMoveAction amAction = self.ActionControl.LookupAction(AttackingMoveAction.SGetActionType()) as AttackingMoveAction;
                if (amAction != null)
                {
                    ++amAction.m_skillResultIDIndex;
                    amAction.CreateSkillResult();
                }
            }
        }
    }