salahzar

ToggleScale.cs

Feb 27th, 2021
876
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UdonSharp;
  2. using UnityEngine;
  3. using VRC.SDKBase;
  4. using VRC.Udon;
  5.  
  6. public class ToggleScale : UdonSharpBehaviour
  7. {
  8.     public Transform capsula;
  9.     public Vector3 dimPiccola = new Vector3(0.5f, 0.5f, 0.5f);
  10.     public Vector3 dimGrossa = new Vector3(2, 2, 2);
  11.  
  12.  
  13.     public bool grossa = true;
  14.     private void Start()
  15.     {
  16.         capsula.localScale = dimGrossa;
  17.         Debug.Log("Il programma e' partito");
  18.     }
  19.  
  20.     public override void Interact()
  21.     {
  22.         Debug.Log("Il valore di grossa e' " + grossa);
  23.         if (grossa)
  24.         {
  25.             Debug.Log("La rimpicciolisco");
  26.             capsula.localScale = dimPiccola;
  27.         }
  28.         else
  29.         {
  30.             Debug.Log("La ingrandisco");
  31.             capsula.localScale = dimGrossa;
  32.         }
  33.        
  34.         grossa = !grossa;
  35.     }
  36. }
  37.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×