예제 #1
0
 public void DestroyMarkers()
 {
     EntranceMarker?.Destroy();
     InteractionMarker?.Destroy();
     GarbageMarker?.Destroy();
     ExitMarker?.Destroy();
 }
예제 #2
0
 public override void StopUsing(VRTK_InteractUse usingObject)
 {
     Debug.Log("stop using interaction marker");
     base.StopUsing(usingObject);
     this.interaction.edit    = false;
     InteractionMarker.active = null;
     EventManager.CloseInteractionUI();
 }
예제 #3
0
    public override void StartUsing(VRTK_InteractUse usingObject)
    {
        Debug.Log("start using interaction marker");
        base.StartUsing(usingObject);

        if (InteractionMarker.active && InteractionMarker.active != this)
        {
            InteractionMarker.active.Close();
        }
        else
        {
            this.interaction.edit    = true;
            InteractionMarker.active = this;

            EventManager.OpenInteractionUI(sim, interaction);
        }
    }
예제 #4
0
        public void CreateProperty()
        {
            EntranceString = OwnerId == 0
                ? $"Unowned. /buyproperty to buy it.\nCosts ~g~${PropertyPrice}~w~"
                : PropertyName;

            EntranceMarker = new MarkerZone(EntrancePos, EntranceRot, EntranceDimension)
            {
                TextLabelText = EntranceString + "\n" + Type + "\n" + "ID: " + Id,
                BlipSprite    = GetBlip(),
                UseBlip       = true
            };
            EntranceMarker.Create();
            EntranceMarker.ColZone.setData("property_entrance", Id);
            if (API.Shared.DoesEntityExist(EntranceMarker.Blip))
            {
                API.Shared.SetBlipShortRange(EntranceMarker.Blip, true);
                API.Shared.SetBlipName(EntranceMarker.Blip, PropertyName);
            }

            if (IsInteractable && InteractionPos != null && InteractionPos != new Vector3())
            {
                if (Type != PropertyManager.PropertyTypes.GasStation)
                {
                    InteractionMarker = new MarkerZone(InteractionPos ?? new Vector3(), InteractionRot ?? new Vector3(), InteractionDimension)
                    {
                        TextLabelText = PropertyManager.GetInteractText(Type)
                    };
                }
                else
                {
                    InteractionMarker = new MarkerZone(InteractionPos ?? new Vector3(), InteractionRot ?? new Vector3(), InteractionDimension)
                    {
                        ColZoneSize   = 10f,
                        TextLabelText = PropertyManager.GetInteractText(Type)
                    };
                }
                InteractionMarker.Create();
                InteractionMarker.ColZone.setData("property_interaction", Id);
            }

            if (IsTeleportable && TargetPos != null && TargetPos != new Vector3())
            {
                ExitMarker = new MarkerZone(TargetPos ?? new Vector3(), TargetRot ?? new Vector3(), TargetDimension)
                {
                    TextLabelText = "/exit"
                };
                ExitMarker.Create();
                ExitMarker.ColZone.setData("property_exit", Id);
            }

            if (HasGarbagePoint)
            {
                if (BinObject != null)
                {
                    API.Shared.DeleteEntity(BinObject);
                }
                BinObject     = null;
                GarbageMarker = new MarkerZone(GarbagePoint + new Vector3(0, 0, 1.2), new Vector3(0, 0, 0), GarbageDimension)
                {
                    ColZoneSize   = 10f,
                    UseMarker     = false,
                    TextLabelText = $"{PropertyName}'s Garbage\nBags: {GarbageBags}/40\n/pickuptrash"
                };
                GarbageMarker.Create();
                GarbageMarker.ColZone.setData("property_garbage", Id);
                BinObject = API.Shared.CreateObject(998415499, GarbagePoint - new Vector3(0, 0, 1.1), GarbageRotation, GarbageDimension);
            }
        }