42 lines
		
	
	
		
			1000 B
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1000 B
		
	
	
	
		
			C#
		
	
	
	
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using DG.Tweening;
 | |
| 
 | |
| public class FloorManager : S_MonoSingleton<FloorManager>
 | |
| {
 | |
|     private List<GameObject> mGobFloors;
 | |
|     private Renderer mRdrFloor = null;
 | |
| 
 | |
|     protected override void Initialize()
 | |
|     {
 | |
|         base.Initialize();
 | |
| 
 | |
|         mGobFloors = new List<GameObject>();
 | |
|         for (int i = 0; i < transform.childCount; i++)
 | |
|         {
 | |
|             mGobFloors.Add(transform.GetChild(i).gameObject);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public void SetFloor(int pFloorID)
 | |
|     {
 | |
|         mRdrFloor = null;
 | |
|         for (int i = 0; i < mGobFloors.Count; i++)
 | |
|         {
 | |
|             mGobFloors[i].SetActive(i == pFloorID - 1);
 | |
|             if (i == pFloorID - 1)
 | |
|             {
 | |
|                 mRdrFloor = mGobFloors[i].GetComponent<Renderer>();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public void FloorDisappear()
 | |
|     {
 | |
|         if (mRdrFloor != null)
 | |
|         {
 | |
|             mRdrFloor.material.DOFloat(1, "_Dissolve", 1f);
 | |
|         }
 | |
|     }
 | |
| } |