Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save EreminAndrei/53f224cecef43433997b8de7cd151b77 to your computer and use it in GitHub Desktop.
Save EreminAndrei/53f224cecef43433997b8de7cd151b77 to your computer and use it in GitHub Desktop.
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