Advertisement
gandalfbialy

Untitled

Apr 12th, 2025
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class WinPlace : MonoBehaviour
  5. {
  6.     float alfa = 0;
  7.     void FixedUpdate()
  8.     {
  9.         float scale = Resizer();
  10.         transform.localScale = new Vector3(scale, 4.5f, scale);
  11.     }
  12.     public float Resizer()
  13.     {
  14.         float value = Mathf.Sin(alfa);
  15.         alfa += (1.5f * Time.deltaTime);
  16.         return value + 2f;
  17.     }
  18.     private void OnTriggerEnter(Collider other)
  19.     {
  20.         if (other.gameObject.tag == "Player")
  21.         {
  22.             GameManager.gameManager.WinGame();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement