49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
public class InitSoulStart : MonoBehaviour {
|
|
|
|
public GameObject[] Starts = new GameObject[5];
|
|
public GameObject[] child1s = new GameObject[5];
|
|
public GameObject[] child2s = new GameObject[5];
|
|
|
|
public void ClearInfo(bool state)
|
|
{
|
|
for(int i=0;i< Starts.Length;i++)
|
|
{
|
|
Starts[i].SetActive(false);
|
|
child1s[i].SetActive(false);
|
|
child2s[i].SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void InitStart(int start)
|
|
{
|
|
ClearInfo(start > 0);
|
|
|
|
int startNum = start / 3;
|
|
int halfStar = start % 3;
|
|
int i = 0;
|
|
for(i = 0;i < startNum; i++)
|
|
{
|
|
if(i<Starts.Length)
|
|
{
|
|
Starts[i].SetActive(true);
|
|
child2s[i].SetActive(true);
|
|
}
|
|
}
|
|
if( i < Starts.Length)
|
|
{
|
|
Starts[i].SetActive(halfStar > 0);
|
|
child1s[i].SetActive(halfStar == 2);
|
|
}
|
|
i++;
|
|
for(;i<Starts.Length;i++)
|
|
{
|
|
Starts[i].SetActive(false);
|
|
}
|
|
}
|
|
|
|
}
|