Пример #1
0
 //Has to be public for the interface
 public void AttackAction(MovementAndMethod someAttack)
 {
     if (!currentlyInAttackAnimation)
     {
         anim.SetTrigger(someAttack.GetActionKey());
         itemInUseByCharacter.InfluenceEnvironment(someAttack.GetActionEnum());
         if (someAttack.GetActionEnum() != MovementAndMethod.PossibleMovements.CreatePhysicalItem)
         {
             currentlyInAttackAnimation = true;
         }
     }
     else
     {
         Debug.Log(gameObject.name + " was in attack animation, did not attack");
     }
 }
Пример #2
0
    //Just the default moves for an item, should be changed via a child script if these are not the attacks that you are looking for.
    public override MovementAndMethod[] GetPossibleActionsForItem()
    {
        MovementAndMethod[] possibleMoves;
        //Add default moves, if it is null otherwise.
        if (movementTriggerPair == null || movementTriggerPair.Length == 0)
        {
            possibleMoves     = new MovementAndMethod[2];
            possibleMoves [0] = new MovementAndMethod(MovementAndMethod.PossibleMovements.Stab, MovementAndMethod.PossibleTriggers.LeftMouseClick, false);
            possibleMoves [1] = new MovementAndMethod(MovementAndMethod.PossibleMovements.OverheadSlice, MovementAndMethod.PossibleTriggers.RightMouseClick, false);
        }
        else
        {
            //Convert the array of enums MovementAndMethod classes.  The constructor converts everything.
            possibleMoves = new MovementAndMethod[movementTriggerPair.Length];
            //Define all of the movement and trigger pair values based off of the serializable list.
            for (int i = 0; i < movementTriggerPair.Length; i++)
            {
                possibleMoves [i] = new MovementAndMethod(movementTriggerPair [i].attack, movementTriggerPair [i].method, movementTriggerPair [i].worksMidair);
            }
        }

        return(possibleMoves);
    }
Пример #3
0
 public override MovementAndMethod[] GetPossibleActionsForItem()
 {
     MovementAndMethod[] possibleMoves = new MovementAndMethod[1];
     possibleMoves [0] = new MovementAndMethod(MovementAndMethod.PossibleMovements.OverheadSlice, MovementAndMethod.PossibleTriggers.LeftMouseClick, false);
     return(possibleMoves);
 }