Ejemplo n.º 1
0
        public CommonAnimal SpawnAnimal(Vector3 p, Quaternion r)
        {
            var packet = new Packet().Basic(p.Net()).SpawnAnimal(++m_NextId, p, r);

            MatchCommunicationManager.instance.RpcAsync(packet);
            return(SpawnAnimal(packet.Spawn.Animal.Transform));
        }
Ejemplo n.º 2
0
        public Vegetation SpawnTree(Vector3 p, Quaternion r)
        {
            var packet = new Packet().Basic(p.Net()).SpawnTree(++m_NextId, p, r);

            MatchCommunicationManager.instance.RpcAsync(packet);
            return(SpawnTree(packet.Spawn.Tree.Transform));
        }
Ejemplo n.º 3
0
 private void OnDestinationChanged(Vector3 obj)
 {
     Mcm.instance.RpcAsync(new Packet
     {
         NavMeshUpdate = new NavMeshUpdate
         {
             Id          = id,
             Destination = obj.Net()
         }
     });
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Notify tree spawn and spawn locally
        /// </summary>
        /// <param name="p"></param>
        /// <param name="r"></param>
        /// <param name="c"></param>
        /// <param name="cMin"></param>
        /// <param name="cMax"></param>
        /// <returns></returns>
        public Plant SpawnPlantSync(Vector3 p, Quaternion r, Characteristics c, Characteristics cMin, Characteristics cMax)
        {
            var veg = SpawnPlant(p, r, c, cMin, cMax);

            if (!Gm.instance.online)
            {
                return(veg);
            }
            var packet = new Packet().Basic(p.Net()).SpawnPlant(_nextId + 1, p, r);

            Mcm.instance.RpcAsync(packet);
            return(veg);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Spawn animal and sync if online
        /// </summary>
        /// <param name="p">Position</param>
        /// <param name="r">Rotation</param>
        /// <param name="c"></param>
        /// <param name="cMin"></param>
        /// <param name="cMax"></param>
        /// <returns></returns>
        public CommonAnimal SpawnAnimalSync(Vector3 p, Quaternion r, Characteristics c, Characteristics cMin, Characteristics cMax)
        {
            var animal = SpawnAnimal(p, r, c, cMin, cMax);

            if (!Gm.instance.online)
            {
                return(animal);
            }
            var packet = new Packet().Basic(p.Net()).SpawnAnimal(_nextId + 1, p, r);

            Mcm.instance.RpcAsync(packet);
            return(animal);
        }
Ejemplo n.º 6
0
 public void RequestSpawnTree(Vector3 p, Quaternion r)
 => MatchCommunicationManager.instance.RpcAsync(new Packet().Basic(p.Net()).ReqSpawnTree(p, r));
Ejemplo n.º 7
0
 /// <summary>
 /// Ask executors to spawn a Plant
 /// </summary>
 /// <param name="p"></param>
 /// <param name="r"></param>
 public void RequestSpawnPlant(Vector3 p, Quaternion r)
 => Mcm.instance.RpcAsync(new Packet().Basic(p.Net()).ReqSpawnPlant(p, r));