Ejemplo n.º 1
0
    public override void Attached()
    {
        if (BoltNetwork.isClient)
        {
            this.ClientTransform = new GameObject(base.gameObject.name + "_CLIENTTRANSFORM").GetComponent <Transform>();
            base.state.Transform.SetTransforms(this.ClientTransform);
        }
        else
        {
            base.state.Transform.SetTransforms(base.transform);
        }
        ClothingPickup componentInChildren = base.GetComponentInChildren <ClothingPickup>(true);

        if (componentInChildren != null)
        {
            componentInChildren.Attached();
        }
        if (base.entity.isOwner)
        {
            if (this.ClothPickup && !this.ClothPickup.activeSelf)
            {
                base.state.ClothPickedUp = true;
            }
            base.state.Open = this.Interior.gameObject.activeSelf;
        }
        if (this.ClothPickup)
        {
            base.state.AddCallback("ClothPickedUp", new PropertyCallbackSimple(this.OnClothPickup));
        }
        if (this.FlarePickups.Length > 0)
        {
            base.state.AddCallback("FlaresPickedUp", new PropertyCallbackSimple(this.OnFlaresPickedUp));
        }
        base.state.AddCallback("Open", new PropertyCallbackSimple(this.OnOpen));
    }
Ejemplo n.º 2
0
 public override void OnEvent(TakeClothingOutfit evnt)
 {
     if (this.ValidateSender(evnt, SenderTypes.Any))
     {
         if (evnt.target == null)
         {
             return;
         }
         if (!evnt.target.isOwner)
         {
             return;
         }
         ClothingPickup componentInChildren = evnt.target.GetComponentInChildren <ClothingPickup>(true);
         if (componentInChildren == null)
         {
             return;
         }
         componentInChildren.DoBoltTaken();
     }
 }