Exemple #1
0
 public void HandleNotAcceptableState(NodeAddedEvent e, [Combine] InteractivityPrerequisiteStates.NotAcceptableState prerequisite, [JoinByScreen, Combine, Context] DependentInteractivityNode interactableElement)
 {
     interactableElement.dependentInteractivity.SetInteractable(false);
 }
Exemple #2
0
 public void InitESM(NodeAddedEvent e, [Combine] InteractivityPrerequisiteNode prerequisite, [JoinByScreen, Combine, Context] DependentInteractivityNode interactableElement)
 {
     if (!prerequisite.Entity.HasComponent <InteractivityPrerequisiteESMComponent>())
     {
         InteractivityPrerequisiteESMComponent component = new InteractivityPrerequisiteESMComponent();
         prerequisite.Entity.AddComponent(component);
         EntityStateMachine esm = component.Esm;
         esm.AddState <InteractivityPrerequisiteStates.AcceptableState>();
         esm.AddState <InteractivityPrerequisiteStates.NotAcceptableState>();
         esm.ChangeState <InteractivityPrerequisiteStates.NotAcceptableState>();
     }
 }
Exemple #3
0
        public void HandleAcceptableState(NodeAddedEvent e, [Combine] InteractivityPrerequisiteStates.AcceptableState prerequisiteNode, [JoinByScreen, Combine, Context] DependentInteractivityNode interactableElementNode)
        {
            DependentInteractivityComponent dependentInteractivity = interactableElementNode.dependentInteractivity;

            for (int i = 0; i < dependentInteractivity.prerequisitesObjects.Count; i++)
            {
                GameObject gameObject = dependentInteractivity.prerequisitesObjects[i].gameObject;
                if (gameObject.activeInHierarchy)
                {
                    EntityBehaviour component = gameObject.GetComponent <EntityBehaviour>();
                    if ((component.Entity != null) && component.Entity.HasComponent <NotAcceptableStateComponent>())
                    {
                        dependentInteractivity.SetInteractable(false);
                        return;
                    }
                }
            }
            dependentInteractivity.SetInteractable(true);
        }