Shamba

Skin_Instantiator 2

Aug 7th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Skin_Instantiator : MonoBehaviour {
  6.  
  7.     public GameObject[] Skins;      
  8.  
  9.     // Use this for initialization
  10.     void Start ()
  11.     {
  12.        
  13.     }
  14.    
  15.     // Update is called once per frame
  16.     void Update ()
  17.     {
  18.         if(Input.GetKeyDown(KeyCode.Alpha1))
  19.         {
  20.             Skins[0].gameObject.SetActive(true);
  21.             Skins[1].gameObject.SetActive(false);
  22.         }
  23.         if (Input.GetKeyDown(KeyCode.Alpha2))
  24.         {
  25.             Skins[1].gameObject.SetActive(true);
  26.             Skins[0].gameObject.SetActive(false);
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment