void Awake() { cam = GetComponentInChildren <Camera> (); pawnPlayer = GetComponent <PawnPlayer> (); rb = GetComponent <Rigidbody> (); animator = GetComponentInChildren <Animator> (); collide = GetComponent <CapsuleCollider> (); }
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"); } } }
/** * 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); }
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(); } } }
public override void Possess(APawn pawnPlayer) { pawn = pawnPlayer as PawnPlayer; }
void Start() { player = GameObject.Find("PLAYER").GetComponent <PawnPlayer>(); }
void Start() { player = SwarmController.GetSwarmController().GetPlayer(); }