예제 #1
0
        public void AwakeWheel(List <SelectionWheelNodeData> wheelNodeDatas, Transform followingWorldTransform)
        {
            if (!IsWheelEnabled)
            {
                IsWheelEnabled = true;
                this.followingWorldTransform = followingWorldTransform;

                var SelectionWheelGlobalConfiguration = SelectionWheelGlobalConfigurationGameObject.Get().SelectionWheelGlobalConfiguration;

                if (SelectionWheelGameObject == null)
                {
                    SelectionWheelGameObject      = new SelectionWheelGameObject(CoreGameSingletonInstances.GameCanvas);
                    SelectionWheelObjectAnimation = new SelectionWheelObjectAnimation(SelectionWheelGameObject, SelectionWheelGlobalConfiguration.SelectionWheelEnterAnimation, OnExitAnimationFinished);
                }

                SelectionWheelPositionManager = new SelectionWheelPositionManager(this, SelectionWheelGlobalConfiguration, this.followingWorldTransform);
                SelectionWheelObjectAnimation.PlayEnterAnimation();
                ActionWheelActiveNodeManager   = new ActionWheelActiveNodeManager(SelectionWheelGlobalConfiguration.NonSelectedMaterial, SelectionWheelGlobalConfiguration.SelectedMaterial);
                ActionWheelNodePositionManager = new ActionWheelNodePositionManager(SelectionWheelGlobalConfiguration.ActionWheelNodePositionManagerComponent, GameInputManager.Get(), ActionWheelActiveNodeManager);
                wheelNodes = new SelectionWheelNode[wheelNodeDatas.Count];
                for (var i = 0; i < wheelNodeDatas.Count; i++)
                {
                    var wheelNode = SelectionWheelNode.Instantiate(wheelNodeDatas[i]);
                    wheelNode.transform.SetParent(SelectionWheelGameObject.SelectionWheelNodeContainerGameObject.transform, false);
                    wheelNodes[i] = wheelNode;
                }

                ActionWheelNodePositionManager.InitNodes(wheelNodes);
                ActionWheelActiveNodeManager.SelectedNodeChanged(wheelNodes);
            }
        }
예제 #2
0
        public static SelectionWheelGlobalConfigurationGameObject Get()
        {
            if (Instace == null)
            {
                Instace = FindObjectOfType <SelectionWheelGlobalConfigurationGameObject>();
            }

            return(Instace);
        }