using System.Collections; using System.Collections.Generic; using UnityEngine; public class UserSelectionpanelManager : MonoBehaviour { // Start is called before the first frame update public List userSelectionPanelScButton_List; public List userSelectionPanelScButtonClickFX_List; public List userSelectionPanelScButtonEnterFX_List; public GameObject buttonEnterFX; public GameObject buttonClickFX; public GameManagers gameManagers; void Start() { userSelectionPanelScButton_List.ForEach(scObj => { scObj.GetComponent().onClick.AddListener(() => { userSelectionPanelScButton(scObj.name); buttonClickFX.GetComponent().moveToEndV3 = scObj.transform.position; buttonClickFX.GetComponent().userClickButtonStr(scObj.name); buttonEnterFX.GetComponent().userClickButtonStr(scObj.name); }); scObj.GetComponent().onEnter.AddListener(() => { buttonEnterFX.GetComponent().moveToEndV3 = scObj.transform.position; buttonEnterFX.GetComponent().moevToendRotV3 = scObj.transform.rotation; buttonEnterFX.GetComponent().userEnterClick(true, scObj.name); }); scObj.GetComponent().onExit.AddListener(() => { }); }); } private string buttonNames; public void userSelectionPanelScButton(string ButtonName) { if (buttonNames == ButtonName) return; switch (ButtonName) { case "Button0": StartCoroutine(gameManagers.WaitForChildrenAnimEnd(gameManagers.currentReturnAnimName, "MainAnimation", new Vector3(0, -10f, 0), 3)); break; case "Button1": StartCoroutine(gameManagers.WaitForChildrenAnimEnd(gameManagers.currentReturnAnimName, "fragmentAnimationToBasketballCourt", new Vector3(0, 172.653f, 0), 3)); break; case "Button2": StartCoroutine(gameManagers.WaitForChildrenAnimEnd(gameManagers.currentReturnAnimName, "fragmentAnimationToCafe", new Vector3(0, 255.633f, 0), 3)); break; case "Button3": StartCoroutine(gameManagers.WaitForChildrenAnimEnd(gameManagers.currentReturnAnimName, "fragmentAnimationToExhibitionHall", new Vector3(0, 74.08f, 0), 3)); break; case "Button4": StartCoroutine(gameManagers.WaitForChildrenAnimEnd(gameManagers.currentReturnAnimName, "fragmentAnimationToConferenceRoom", new Vector3(0, -15f, 0), 3)); break; } buttonNames = ButtonName; } private bool isOpen; public GameObject allGames; public GameObject uiGames; public GameObject houseGames; public GameObject maskGames; public void EditorMove() { if(!isOpen) { allGames.GetComponent().ActiveHandle = BoundingBox.HandleType.None; uiGames.GetComponent().ActiveHandle = BoundingBox.HandleType.None; houseGames.GetComponent().ActiveHandle = BoundingBox.HandleType.None; maskGames.GetComponent().ActiveHandle = BoundingBox.HandleType.None; isOpen = true; } else { allGames.GetComponent().ActiveHandle = BoundingBox.HandleType.Rotation; uiGames.GetComponent().ActiveHandle = BoundingBox.HandleType.Rotation; houseGames.GetComponent().ActiveHandle = BoundingBox.HandleType.Rotation; maskGames.GetComponent().ActiveHandle = BoundingBox.HandleType.Rotation; isOpen = false; } } }