protected void BuildSelectionPlayerDecision(GameObject decisionPrefab)
 {
     if (myDecision == null)
     {
         GameObject decision = Instantiate(decisionPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
         decision.GetComponent <CharacterDecision>().InitialiseMe(playerCharacter);
         decision.transform.SetParent(playerCharacter.transform, false);
         myDecision = decision.GetComponent <CharacterDecision>();
         playerCharacter.MyDecision = myDecision;
     }
 }
 public void EndCurrentSelection()
 {
     DestroySelectionCircle();
     if (myDecision != null)
     {
         if (!myDecision.IsEnding)
         {
             myDecision.EndDecision();
             myDecision = null;
         }
     }
     EndInspection();
     clicked = false;
 }
    public void ProcessMovement(CharacterMovement movementType)
    {
        movement = movementType;
        SetMyDirection(targetPosition, character.GetMyPosition());
        //print("target:" + targetPosition + ", my position: " + myPosition);
        CharacterDecision decision = character.MyDecision;

        print(decision);
        if (decision.GetType() == typeof(CharacterMovementDecision))
        {
            collisionAvoider = character.MyDecision.GetComponent <CollisionAvoider>();
        }
        Debug.Log("MOVEMENT IS: " + movement);
        movement.MakeAction();
        ToggleIsMoving(true);
    }
Example #4
0
 public void ToggleCombatMode()
 {
     if (combatUIactive)
     {
         DeselectAbility();
         abilitiesUI.HideComponents();
         World.UnpauseGame();
         combatUIactive = false;
         if (pendingDecision != null)
         {
             pendingDecision.ProcessDecision();
         }
         SetCursorDefault();
     }
     else
     {
         World.PauseGame();
         abilitiesUI.DisplayComponents();
         underAttackUI.DisplayComponents();
         playerVitalsUI.DisplayComponents();
         combatUIactive  = true;
         pendingDecision = null;
     }
 }
Example #5
0
 public void QueueDecision(CharacterDecision decision)
 {
     pendingDecision = decision;
 }