Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class control_switch : MonoBehaviour {
- private void OnTriggerEnter(Collider other)
- {
- if(other.gameObject.tag == "Player")
- {
- switch (this.gameObject.tag)
- {
- case "type1":
- CubeMovement.control_type = 1;
- break;
- case "type2":
- CubeMovement.control_type = 2;
- break;
- case "type3":
- CubeMovement.control_type = 3;
- break;
- case "type4":
- CubeMovement.control_type = 4;
- break;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment