Ejemplo n.º 1
0
 private void ReceivePawnDeath()
 {
     if (Possession != null)
     {
         Possession.OnDeath -= ReceivePawnDeath;
         Possession = null;
         PossessedCharacterViewID = uLink.NetworkViewID.unassigned;
     }
 }
Ejemplo n.º 2
0
    public void Awake()
    {
        DontDestroyOnLoad(this);
        PossessedCharacterViewID = uLink.NetworkViewID.unassigned;
        LastGUIDebugPositions = new WeakDictionary<PlayerScript, Vector2>();

        // Ladies and gentlemen, the great and powerful Unity
        wasMine = networkView.isMine;

        if (networkView.isMine)
        {
            Name = PlayerPrefs.GetString("username", "Anonymous");

            // TODO will obviously send messages to server twice if there are two local players, fix
            Relay.Instance.MessageLog.OnMessageEntered += ReceiveMessageEntered;
            Relay.Instance.MessageLog.OnCommandEntered += ReceiveCommandEntered;
        }

    }