Пример #1
0
    private void GoToAnyButtonPort(NormalInput e)
    {
        if (logDebugInfo)
        {
            Debug.Log($"Found Button in NormalInput {e.Input}");
        }

        GoToNode(anyButtonPort);
    }
Пример #2
0
        private void OnValidate()
        {
            if (HeightInputType.Type == null)
            {
                HeightInput = null;
            }
            else if (HeightInput == null || HeightInput.GetType() != HeightInputType.Type)
            {
                HeightInput = Activator.CreateInstance(HeightInputType) as HeightInput;
            }

            if (DimensionsInputType.Type == null)
            {
                DimensionsInput = null;
            }
            else if (DimensionsInput == null || DimensionsInput.GetType() != DimensionsInputType.Type)
            {
                DimensionsInput = Activator.CreateInstance(DimensionsInputType) as DimensionsInput;
            }

            if (GrassMapInputType.Type == null)
            {
                GrassMapInput = null;
            }
            else if (GrassMapInput == null || GrassMapInput.GetType() != GrassMapInputType.Type)
            {
                GrassMapInput = Activator.CreateInstance(GrassMapInputType) as GrassMapInput;
            }

            if (NormalInputType.Type == null)
            {
                NormalInput = null;
            }
            else if (NormalInput == null || NormalInput.GetType() != NormalInputType.Type)
            {
                NormalInput = Activator.CreateInstance(NormalInputType) as NormalInput;
            }

            if (PositionInputType.Type == null)
            {
                PositionInput = null;
            }
            else if (PositionInput == null || PositionInput.GetType() != PositionInputType.Type)
            {
                PositionInput = Activator.CreateInstance(PositionInputType) as PositionInput;
            }

            if (PatchContainerType.Type == null)
            {
                PatchContainer = null;
            }
            else if (PatchContainer == null || PatchContainer.GetType() != PatchContainerType.Type)
            {
                PatchContainer = Activator.CreateInstance(PatchContainerType) as PatchContainer;
            }
        }
Пример #3
0
    private void HandleInput(NormalInput e)
    {
        if (logDebugInfo)
        {
            Debug.Log($"HandleInput {name}");
        }

        if (ConnectedButtonPressed(e))
        {
            return;
        }

        GoToAnyButtonPort(e);
    }
Пример #4
0
    private bool ConnectedButtonPressed(NormalInput e)
    {
        for (int i = 0; i < Buttons.Count; i++)
        {
            if (Buttons[i].HasFlag(e.Input))
            {
                if (logDebugInfo)
                {
                    Debug.Log($"Found Button in Buttons {e.Input}");
                }

                GoToNode(GetButtonPort(i));
                return(true);
            }
        }

        return(false);
    }
Пример #5
0
 private void OnInterrupted(NormalInput e)
 {
     // if (logDebugInfo)
     Debug.Log($"OnInterrupted {name} {e.Input}");
     Events.Instance.Raise(new InterruptedInput(e.Input));
 }