Untitled

 avatar
unknown
plain_text
3 years ago
707 B
9
Indexable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PuyoRotate : MonoBehaviour
{
    // Start is called before the first frame update
    public int Degrees = 0;
    void Start()
    {
     
    }

    // Update is called once per frame
    void Update()
    {
     if (Input.GetKey(KeyCode.Space))
     if (Degrees == 0)
     {transform.Translate (-1, 1, 0);
     Degrees = 90;}
     if (Degrees == 90)
     {transform.Translate (1, 1, 0);
     Degrees = 180;}
     if (Degrees == 180)
     {transform.Translate (1, -1, 0);
     Degrees = 270;}
     if (Degrees == 270)
     {transform.Translate (-1, -1, 0);
     Degrees = 0;}
    }
}
Editor is loading...