public static AddMessage ( string message, Vector3 worldPosition ) : void | ||
message | string | |
worldPosition | Vector3 | |
Результат | void |
void Collide(Transform trans, Vector3 point, Vector3 normal) { bool playerWasHit = DoDamageTo(trans, point); if (playerWasHit) { ScreenSpaceDebug.AddMessage("HIT", point, Color.green); } if (recoil > 0) { DoRecoil(point, playerWasHit); } if (playerWasHit) { EffectsScript.ExplosionHit(point, Quaternion.LookRotation(normal)); } else { EffectsScript.Explosion(point, Quaternion.LookRotation(normal)); } dead = true; Destroy(GetComponent <Rigidbody>()); GetComponent <Renderer>().enabled = false; }
public void DoDamageOwner( int damage, Vector3 point, PlayerPresence instigator) { ScreenSpaceDebug.AddMessage("DAMAGE", point, Color.red); if ( !dead ) { if (invulnerable) return; Shield -= damage; timeUntilShieldRegen = shieldRegenTime; if(Shield < 0) { Health += Shield; Shield = 0; } if(Health <= 0) { Health = 0; dead = true; PlayDeathPrefab(); GetComponent<PlayerScript>().RequestedToDieByOwner(instigator); Camera.main.GetComponent<WeaponIndicatorScript>().CooldownStep = 0; } } }
private void ReceiveStoppedBeingLockedOnBy(PlayerScript enemy) { // ReSharper disable once ConditionIsAlwaysTrueOrFalse // ReSharper disable once HeuristicUnreachableCode if (this == null) { return; } if (networkView.isMine && enemy != null) { ScreenSpaceDebug.AddMessage("UNTARGETED BY", enemy.transform.position); } }
private void ReceiveStartedBeingLockedOnBy(PlayerScript enemy) { // Sometimes unity will call an RPC even if 'this' has already been // 'destroyed', and because unity overloads null comparison to mean // 'destroyed', well, we're going to do this check. Great. // ReSharper disable once ConditionIsAlwaysTrueOrFalse // ReSharper disable once HeuristicUnreachableCode if (this == null) { return; } // Also check if enemy is null, might have been destroyed by the time // this RPC is called. if (networkView.isMine && enemy != null) { ScreenSpaceDebug.AddMessage("TARGETED BY", enemy.transform.position); } }