void HandleHit(Collider2D collider) { if (blackoutState.InBlackout() && blackoutState.blackoutPlayer != playerData.playerId) { return; } BallController bc = collider.GetComponent <BallController>(); if (bc != null && !hitList.Contains(collider) && !state.IsStunned()) { hitList.Add(collider); playerData.AddBallColor(bc.color); bc.Hit(playerData.playerId, attackAngle); bc.Freeze(attackConfig.hitFreezeLength); playerMovement.Freeze(attackConfig.hitFreezeLength); hitCount++; PlayAudioEvent(hitAudioEvent, hitAudioSource); } PVPController pvpc = collider.GetComponent <PVPController>(); if (pvpc != null && !hitList.Contains(collider)) { pvpc.Hit(playerData.playerId); hitList.Add(collider); hitCount++; } }
private void Awake() { instance = this; Hide(); }
// Awake method to be called when this class is instantiated. private void Awake() { Instance = this; Debug.Log("Are we starting the battle"); }