示例#1
0
        public void Return()
        {
            //re-parent object to this spawner
            obj.transform.parent   = PoolManager.GetPool(obj).transform;
            obj.transform.position = transform.position;

            //reset carrier
            Collectible colItem = obj.GetComponent <Collectible>();

            if (colItem != null)
            {
                colItem.carrierId = -1;
                colItem.OnReturn();
            }

            //cancel return timer as the object is now back at its base position
            if (PhotonNetwork.IsMasterClient)
            {
                StopAllCoroutines();
            }
        }
示例#2
0
        /// <summary>
        /// Returns the object back to this spawner's position. E.g. in Capture The Flag mode this
        /// can occur if a team collects its own flag, or a flag timed out after being dropped.
        /// </summary>
        public void Return()
        {
            //re-parent object to this spawner
            obj.transform.parent   = PoolManager.GetPool(obj).transform;
            obj.transform.position = transform.position;
            obj.transform.rotation = Quaternion.identity;

            //reset carrier
            Collectible colItem = obj.GetComponent <Collectible>();

            if (colItem != null)
            {
                colItem.carrierId = new NetworkInstanceId(0);
                colItem.OnReturn();
            }

            //cancel return timer as the object is now back at its base position
            if (isServer)
            {
                StopAllCoroutines();
            }
        }