Exemple #1
0
        public override void SetHeight(float height)
        {
            Vector3 newPosition = position;

            newPosition.y = height;

            if (PropLayer.Manager.GetSnappingState())
            {
                float terrainHeight = Singleton <TerrainManager> .instance.SampleDetailHeight(newPosition);

                if (height > terrainHeight + 0.075f || height < terrainHeight - 0.075f)
                {
                    PropLayer.Manager.SetFixedHeight(id, true);
                }
                else
                {
                    PropLayer.Manager.SetFixedHeight(id, false);
                }
            }

            IProp prop = PropLayer.Manager.Buffer(id);

            prop.MoveProp(newPosition);
            prop.UpdatePropRenderer(true);
        }
Exemple #2
0
        public override void Move(Vector3 location, float angle)
        {
            if (!isValid)
            {
                return;
            }

            IProp prop = PropLayer.Manager.Buffer(id);

            prop.Angle = angle;
            prop.MoveProp(location);
            prop.UpdatePropRenderer(true);
        }
Exemple #3
0
        public override void LoadFromState(InstanceState state)
        {
            if (!(state is PropState propState))
            {
                return;
            }

            IProp prop = PropLayer.Manager.Buffer(id);

            prop.Angle       = propState.angle;
            prop.FixedHeight = propState.fixedHeight;

            prop.MoveProp(propState.position);
            prop.UpdatePropRenderer(true);
        }