Beispiel #1
0
 public void OnTargetHit(QTETarget target)
 {
     targets.Remove(target);
     if (targets.Count == 0 && qteDuration > 0)
     {
         onSuccess();
         qteDuration = 0;
     }
 }
Beispiel #2
0
 private bool CheckMaintainCondition(QTECondition qteCondition)
 {
     if (!Singleton <AvatarManager> .Instance.IsLocalAvatar(this._avatarActor.runtimeID))
     {
         if (Singleton <EventManager> .Instance.GetActor <AvatarActor>(Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID()).MuteOtherQTE)
         {
             return(false);
         }
         for (int i = 0; i < this._qteTargetList.Count; i++)
         {
             QTETarget target = this._qteTargetList[i];
             target.Core();
             if (!target.CanCheck())
             {
                 return(true);
             }
             MonsterActor monsterActor = target.monsterActor;
             if (((monsterActor != null) && (monsterActor.isAlive != 0)) && this.QTERangeCheck(monsterActor, qteCondition.QTERange))
             {
                 if (qteCondition.QTEType == QTEConditionType.QTEAnimationTag)
                 {
                     for (int j = 0; j < qteCondition.QTEValues.Length; j++)
                     {
                         MonsterData.MonsterTagGroup tagGroup = (MonsterData.MonsterTagGroup)((int)Enum.Parse(typeof(MonsterData.MonsterTagGroup), qteCondition.QTEValues[j]));
                         if (monsterActor.monster.IsAnimatorInTag(tagGroup))
                         {
                             return(true);
                         }
                     }
                 }
                 else if (qteCondition.QTEType == QTEConditionType.QTEBuffTag)
                 {
                     for (int k = 0; k < qteCondition.QTEValues.Length; k++)
                     {
                         AbilityState state = (AbilityState)((int)Enum.Parse(typeof(AbilityState), qteCondition.QTEValues[k]));
                         if ((monsterActor.abilityState & state) != AbilityState.None)
                         {
                             return(true);
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
Beispiel #3
0
    public void startQTE(int targetCount, float qteDuration, Action onSuccess)
    {
        this.qteDuration = qteDuration;
        this.onSuccess   = onSuccess;
        this.qteTimer    = 0;
        ClearQTE();

        for (int i = 0; i < targetCount; i++)
        {
            QTETarget     newTarget = Instantiate(targetPrefab, gameObject.transform);
            RectTransform rect      = newTarget.GetComponent <RectTransform>();

            newTarget.manager            = this;
            newTarget.transform.position = new Vector2(UnityEngine.Random.Range(0, Screen.width - rect.rect.width) + rect.rect.width / 2, UnityEngine.Random.Range(0, Screen.height - rect.rect.height) + rect.rect.height / 2);

            targets.Add(newTarget);
        }
    }