PlayerScript.ReceiveStartedBeingLockedOnBy C# (CSharp) Méthode

ReceiveStartedBeingLockedOnBy() private méthode

private ReceiveStartedBeingLockedOnBy ( PlayerScript enemy ) : void
enemy PlayerScript
Résultat void
    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);
        }
    }