Example #1
0
 public void SetNextState()
 {
     state = animatorMachineStates[(stateIndex % (animatorMachineStates.Length - 1)) + 1];
     stateIndex++;
     state.enabled = true;
     HandleState();
 }
Example #2
0
    private void Update()
    {
        if (state != null)
        {
            return;
        }

        if (_input.IsClick() && gridManager.IsMapAreaFrom(_input.MousePosition))
        {
            Info.oldMousePos = _input.MousePosition;
            SetClosestAndSideTripleHexagon(_input.MousePosition);
            rotateState.SetPosAndRot(Info.selectedTripleHexagons);
        }
        else if (_input.IsRotate() && Info.selectedTripleHexagons[0] != null)
        {
            SetClosestAndSideTripleHexagon(Info.oldMousePos);
            ChangeParentOfSelectedHexagons(rotateState.transform);
            state = rotateState;
            HandleState();
        }

        if (Input.GetKeyDown(KeyCode.H))
        {
            for (int i = 0; i < AllHexagon.Count; i++)
            {
                Hexagon hex = AllHexagon.ElementAt(i).Value;
                hex.RequestMakeFallAnim(hex.transform.position + Vector3.down * 10);
            }
        }
    }
Example #3
0
 private void Start()
 {
     cam              = Camera.main;
     gridManager      = FindObjectOfType <GridManager>();
     rotateState      = FindObjectOfType <RotateState>();
     hexFallSpeed     = 1f / hexFallTime;
     hexCreatingSpeed = 1f / hexCreatingTime;
     Info             = new SelectionInfo();
     _input           = inputObject as IInput;
     state            = null;
 }
Example #4
0
 public void SetStateNull()
 {
     state = null;
 }