Ejemplo n.º 1
0
    /// <summary>
    ///
    /// </summary>
    public virtual void Awake()
    {
        Transform = transform;

        // ensure that all network players ever created are added to the
        // player list. NOTE: we don't add players to the 'PlayerIDs'
        // dictionary here, since ID has not been assigned yet and is 0
        if (!Players.ContainsKey(Transform.root) && !Players.ContainsValue(this))
        {
            Players.Add(Transform.root, this);
        }

        if (DontDestroyOnLoad)
        {
            UnityEngine.Object.DontDestroyOnLoad(transform.gameObject);
        }
    }