Exemplo n.º 1
0
        private void OnParticleCollision(GameObject other)
        {
            var id            = Convert.ToUInt64(other.transform.name);
            var otherPosition = other.transform.position;
            var region        = new Protometry.Box()
            {
                Min = (otherPosition - other.transform.localScale).ToVector3(),
                Max = (otherPosition + other.transform.localScale).ToVector3()
            };
            // Record.Log($"{otherPosition} - {region}");
            var p = new Packet {
                DestroyObject = new Packet.Types.DestroyObjectPacket {
                    ObjectId = id, Region = region
                }
            };

            SessionManager.Instance.Client.Send(p);
            Pool.Despawn(gameObject);
        }
Exemplo n.º 2
0
        public void UpdateParameters(double timeScale = 0, bool debug = false, Protometry.Box cullingArea = null)
        {
            var p = new Packet();
            var t = new Packet.Types.UpdateParametersPacket.Types.Parameter();

            if (timeScale != 0)
            {
                t.TimeScale = timeScale;
            }
            if (debug)
            {
                t.Debug = debug;
            }
            if (cullingArea != null)
            {
                t.CullingArea = cullingArea;
            }
            p.UpdateParameters = new Packet.Types.UpdateParametersPacket();
            p.UpdateParameters.Parameters.Add(t);
            Instance.Client.Send(p);
        }