1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class UserSelectionpanelManager : MonoBehaviour
- {
- // Start is called before the first frame update
- public List<GameObject> userSelectionPanelScButton_List;
- public List<GameObject> userSelectionPanelScButtonClickFX_List;
- public List<GameObject> userSelectionPanelScButtonEnterFX_List;
- public GameObject buttonEnterFX;
- public GameObject buttonClickFX;
- public GameManagers gameManagers;
- void Start()
- {
- userSelectionPanelScButton_List.ForEach(scObj =>
- {
- scObj.GetComponent<SCButton>().onClick.AddListener(() =>
- {
- userSelectionPanelScButton(scObj.name);
- buttonClickFX.GetComponent<UserSelectionpaneClickFX>().moveToEndV3 = scObj.transform.position;
- buttonClickFX.GetComponent<UserSelectionpaneClickFX>().userClickButtonStr(scObj.name);
- buttonEnterFX.GetComponent<UserSelectionpaneEnterFX>().userClickButtonStr(scObj.name);
- });
- scObj.GetComponent<SCButton>().onEnter.AddListener(() =>
- {
- buttonEnterFX.GetComponent<UserSelectionpaneEnterFX>().moveToEndV3 = scObj.transform.position;
- buttonEnterFX.GetComponent<UserSelectionpaneEnterFX>().moevToendRotV3 = scObj.transform.rotation;
- buttonEnterFX.GetComponent<UserSelectionpaneEnterFX>().userEnterClick(true, scObj.name);
- });
- scObj.GetComponent<SCButton>().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<BoundingBox>().ActiveHandle = BoundingBox.HandleType.None;
- uiGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.None;
- houseGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.None;
- maskGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.None;
-
- isOpen = true;
- }
- else
- {
- allGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.Rotation;
- uiGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.Rotation;
- houseGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.Rotation;
- maskGames.GetComponent<BoundingBox>().ActiveHandle = BoundingBox.HandleType.Rotation;
- isOpen = false;
- }
- }
- }
|