Shamba

control_switch

Mar 12th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class control_switch : MonoBehaviour {
  6.  
  7.     private void OnTriggerEnter(Collider other)
  8.     {
  9.         if(other.gameObject.tag == "Player")
  10.         {
  11.             switch (this.gameObject.tag)
  12.             {
  13.                 case "type1":
  14.                     CubeMovement.control_type = 1;
  15.                     break;
  16.                 case "type2":
  17.                     CubeMovement.control_type = 2;
  18.                     break;
  19.                 case "type3":
  20.                     CubeMovement.control_type = 3;
  21.                     break;
  22.                 case "type4":
  23.                     CubeMovement.control_type = 4;
  24.                     break;
  25.             }
  26.         }
  27.     }
  28. }
Add Comment
Please, Sign In to add comment