-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainChar2.cs
40 lines (35 loc) · 1004 Bytes
/
MainChar2.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MainChar2 : MonoBehaviour
{
public Sprite GokuSprite2, BrolySprite2;
public GameObject Goku2;
public GameObject Broly2;
private SpriteRenderer Sprite;
private readonly string selectChar2 = "selectedCharacter2";
void Awake()
{
Sprite = this.GetComponent<SpriteRenderer>();
}
void Start()
{
int getChar2;
getChar2 = PlayerPrefs.GetInt(selectChar2);
switch (getChar2)
{
case 1:
Sprite.sprite = BrolySprite2;
Goku2.SetActive(false);
break;
case 2:
Sprite.sprite = GokuSprite2;
Broly2.SetActive(false);
break;
default:
Sprite.sprite = BrolySprite2;
Goku2.SetActive(false);
break;
}
}
}