예제 #1
0
 private void Update()
 {
     if (TheForest.Utils.Input.GetButtonDown("Take"))
     {
         LocalPlayer.Sfx.PlayWhoosh();
         if (BoltNetwork.isRunning)
         {
             this.entity.Freeze(false);
             SkinnedAnimal.Create(this.entity).Send();
         }
         else
         {
             this.SinglePlayer_Skinning();
         }
     }
 }
예제 #2
0
    private IEnumerator setSkinnedRoutine()
    {
        int animalType = 0;

        if (this.Lizard || this.Croc)
        {
            animalType = 1;
        }
        else if (this.Rabbit)
        {
            animalType = 2;
        }
        else if (this.Deer)
        {
            animalType = 3;
        }
        else if (this.turtle)
        {
            animalType = 4;
        }
        else if (this.creepy)
        {
            animalType = 5;
        }
        else if (this.boar)
        {
            animalType = 6;
        }
        else if (this.raccoon)
        {
            animalType = 7;
        }
        else if (this.stewardess)
        {
            animalType = 8;
        }
        LocalPlayer.SpecialActions.SendMessage("setAnimalTransform", base.transform.root, SendMessageOptions.DontRequireReceiver);
        LocalPlayer.SpecialActions.SendMessage("setAnimalType", animalType, SendMessageOptions.DontRequireReceiver);
        LocalPlayer.SpecialActions.SendMessage("skinAnimalRoutine", base.transform.position, SendMessageOptions.DontRequireReceiver);
        yield return(YieldPresets.WaitOneSecond);

        yield return(YieldPresets.WaitPointTwoFiveSeconds);

        if (BoltNetwork.isRunning)
        {
            if (base.entity)
            {
                base.entity.Freeze(false);
            }
            this.SetSkinned();
            yield return(YieldPresets.WaitOneSecond);

            yield return(YieldPresets.WaitPointTwoFiveSeconds);

            this.tryAddSkin();
            if (base.entity)
            {
                SkinnedAnimal skinnedAnimal = SkinnedAnimal.Create(GlobalTargets.Everyone);
                skinnedAnimal.Target = base.transform.GetComponentInParent <BoltEntity>();
                skinnedAnimal.Send();
            }
            UnityEngine.Object.Destroy(base.gameObject);
        }
        else
        {
            this.SinglePlayer_Skinning();
            yield return(YieldPresets.WaitOneSecond);

            yield return(YieldPresets.WaitPointFiveSeconds);

            yield return(YieldPresets.WaitPointTwoFiveSeconds);

            this.tryAddSkin();
            UnityEngine.Object.Destroy(base.gameObject);
        }
        yield break;
    }