Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class scriptkubus : MonoBehaviour {
  6.  
  7.     public bool Cube1,Cube2,Cube3,Cube4;
  8.     public string PilihKubus, PilihTag;
  9.     public GameObject PilihObjek;
  10.  
  11.  
  12.     // Use this for initialization
  13.     // void Start () {
  14.        
  15.     // }
  16.    
  17.     // Update is called once per frame
  18.     void Update () {
  19.         if(Cube1) transform.Rotate(1,0,0);
  20.         if(Cube2) GameObject.Find(PilihKubus).transform.Rotate(0,1,0);
  21.         if(Cube3) GameObject.FindGameObjectWithTag(PilihTag).transform.Rotate(0,0,1);
  22.         if(Cube4 && PilihObjek != null) PilihObjek.transform.Rotate(1,1,1);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement