Beispiel #1
0
        internal void Awake()
        {
            m_ownerCharacter = this.gameObject.GetComponent <PlayerSystem>().ControlledCharacter;
            m_startPosition  = m_ownerCharacter.transform.position;

            // get closest character to spectate
            var list = new List <Character>();

            CharacterManager.Instance.FindCharactersInRange(m_ownerCharacter.transform.position, 10f, ref list);
            if (list.Contains(m_ownerCharacter))
            {
                list.Remove(m_ownerCharacter);
            }

            // disable character
            RPCManager.SendSetPlayerActive(m_ownerCharacter.UID, false);

            // enable free camera
            SetFreeCam(true);

            // pick any closest character to spectate
            if (list.Count > 0)
            {
                SetTarget(list[0]);
            }
        }
        internal void Awake()
        {
            m_ownerCharacter = this.gameObject.GetComponent <PlayerSystem>().ControlledCharacter;
            m_startPosition  = m_ownerCharacter.transform.position;

            // disable character
            RPCManager.SendSetPlayerActive(m_ownerCharacter.UID, false);

            // enable free camera
            SetFreeCam(true);
        }
        public void EndSpectate()
        {
            // end free camera
            ReleaseTarget();
            SetFreeCam(false);

            // enable character
            RPCManager.SendSetPlayerActive(m_ownerCharacter.UID, true);
            m_ownerCharacter.transform.position = m_startPosition;

            Destroy(this);
        }
Beispiel #4
0
        public void EndSpectate()
        {
            // end free camera
            ReleaseTarget();
            SetFreeCam(false);

            // enable character
            RPCManager.SendSetPlayerActive(m_ownerCharacter.UID, true);
            m_ownerCharacter.Teleport(m_startPosition, Quaternion.identity);

            Destroy(this);
        }