Shamba

Skin Instantiator

Aug 6th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 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.     private string Skin_type;
  9.     public Vector3 Skin_pos;
  10.     public Quaternion Skin_rot;
  11.  
  12.     // Use this for initialization
  13.     void Start ()
  14.     {
  15.         Skin_type = PlayerPrefs.GetString("Skin_type", "Normal");
  16.         switch(Skin_type)
  17.         {
  18.             case "Normal":
  19.                 Instantiate(Skins[0], Skin_pos, Skin_rot);
  20.                 break;
  21.             case "Headphone":
  22.                 Instantiate(Skins[1], Skin_pos, Skin_rot);
  23.                 break;
  24.         }
  25.     }
  26.    
  27.     // Update is called once per frame
  28.     void Update () {
  29.        
  30.     }
  31. }
Add Comment
Please, Sign In to add comment