Created
July 3, 2024 10:09
-
-
Save EreminAndrei/53f224cecef43433997b8de7cd151b77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CapsuleScale : MonoBehaviour | |
{ | |
[SerializeField] private float _speed; | |
private void Update() | |
{ | |
var nextScale = transform.localScale; | |
nextScale *= _speed; | |
transform.localScale = nextScale; | |
} | |
} | |
public class CubeMover : MonoBehaviour | |
{ | |
[SerializeField] private float _speed; | |
private void Update() | |
{ | |
transform.Rotate(0, _speed, 0); | |
} | |
} | |
public class SphereMover : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
transform.Translate(0, 0, Time.deltaTime); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment