static void Main(string[] args) { ButtonLogic rb = new ButtonLogic(); rb.SetList(); Console.WriteLine(rb.groupA.Count); }
private void Form1_Load(object sender, EventArgs e) { _bl = new ButtonLogic(); stopwatch = new MyTimer(); _bl.SetList(); SetButtonText(_bl.groupA); }
public PressButtonStep(ButtonLogic button, Agent agent, World world) { Button = button; Agent = agent; Cost = 1.0f; // Distance from agent? Time? Expected = world.Step(); // Make a deep copy here? var results = Expected.GetState(button.gameObject.name) as ButtonPlanningState; results.IsPressed = true; }
public void Hover(ButtonLogic button) { int index = ButtonIndex(button); if (index < 0) { return; } SetIndex(index); }
public void Idle(ButtonLogic button) { int index = ButtonIndex(button); if (index < 0) { return; } if (m_currentIndex == index) { SetIndex(-1); } }
public void Press(ButtonLogic button) { int index = ButtonIndex(button); if (index < 0) { return; } SetIndex(index); button.SetPressed(); Event <ButtonPressEvent> .Broadcast(new ButtonPressEvent(index)); SoundSystem.Instance().play(m_pressSound); }
public void Remove(ButtonLogic button) { int index = ButtonIndex(button); if (index < 0) { return; } if (m_currentIndex == index) { SetIndex(-1); } m_buttons.Remove(button); }
// Use this for initialization void Start() { broadcast = true; Button = GetComponent <ButtonLogic>(); // == PRECONDITIONS == // preconditions = new StateList(); // All of the blocking doors must be opened foreach (DoorLogic d in BlockingDoors) { string state = d.gameObject.name + " is open"; preconditions.SetState(state, 1.0f); } // The button has to not be already pressed preconditions.SetState(Button.gameObject.name + " is pressed", 0.0f); // == POSTCONDITIONS == // postconditions = new StateList(); // Our postconditions is the button is pressed postconditions.SetState(Button.gameObject.name + " is pressed", 1.0f); // And the door the button was hooked up to is opened if (Button.door) { postconditions.SetState(Button.door.gameObject.name + " is open", 1.0f); } }
public ButtonPlanningState(ButtonLogic button) { Name = button.gameObject.name; IsPressed = button.IsPressed; Position = button.transform.position; }
void Start() { rScript = Right.GetComponent<ButtonLogic>(); lScript = Left.GetComponent<ButtonLogic>(); jScript = Jump.GetComponent<ButtonLogic>(); }
int ButtonIndex(ButtonLogic button) { return(m_buttons.IndexOf(button)); }