void Awake()
 {
     cam        = GetComponentInChildren <Camera> ();
     pawnPlayer = GetComponent <PawnPlayer> ();
     rb         = GetComponent <Rigidbody> ();
     animator   = GetComponentInChildren <Animator> ();
     collide    = GetComponent <CapsuleCollider> ();
 }
Beispiel #2
0
 public void OnPawnSpawned(Pawn pawn)
 {
     if( !pawn.isEnemy )
     {
         playerPawn = pawn.GetComponent<PawnPlayer>();
         if( playerPawn )
         {
             mc = playerPawn.gameObject;
             Debug.Log("Found player pawn component");
         }
         playerController = pawn.GetComponent<PawnPlayerController>();
         if( playerController )
         {
             Debug.Log("Found player controller component");
         }
     }
 }
Beispiel #3
0
 /**
  * Actual strike. Damage are dealt, dodge are tried and combo are increased
  */
 void StrikePoint()
 {
     // If the target has a dodge component and is actually dodging the strike is canceled
     if (target.GetDodge() != null)
     {
         if (target.GetDodge().IsDodging())
         {
             return;
         }
     }
     // If the pawn is a player, the combo are added to its comboMeter
     if (pawn is PawnPlayer)
     {
         PawnPlayer pawnPlayer = pawn as PawnPlayer;
         pawnPlayer.GetCombo().AddCombo(comboStrikeValue);
     }
     // Damage are dealt
     target.GetHealth().TakeDamage(attackDamage);
 }
Beispiel #4
0
 public void Dodge()
 {
     pawn.GetAnimator().Play("Dodge");
     if (canDodge)
     {
         bDodging = true;
         if (pawn is PawnPlayer)
         {
             PawnPlayer pawnPlayer = pawn as PawnPlayer;
             pawnPlayer.GetCombo().AddCombo(1);
         }
     }
     else
     {
         // If the pawn is a player and he failed its dodge, the combo is reset
         if (pawn is PawnPlayer)
         {
             PawnPlayer pawnPlayer = pawn as PawnPlayer;
             pawnPlayer.GetCombo().ResetCombo();
         }
     }
 }
Beispiel #5
0
 public override void Possess(APawn pawnPlayer)
 {
     pawn = pawnPlayer as PawnPlayer;
 }
Beispiel #6
0
 void Start()
 {
     player = GameObject.Find("PLAYER").GetComponent <PawnPlayer>();
 }
Beispiel #7
0
 void Start()
 {
     player = SwarmController.GetSwarmController().GetPlayer();
 }