Esempio n. 1
0
        private void AssignTriggers()
        {
            foreach (var item in addedGameObjects)
            {
                if (item is TopDownTrigger)
                {
                    triggers.Add((TopDownTrigger)item);
                }
                if (item is TopDownTriggerableObject)
                {
                    triggeredObjs.Add((TopDownTriggerableObject)item);
                }
            }
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 1).OnTraversingEmancipationGrill += OnTraversingGrillID1;
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 2).OnTraversingEmancipationGrill += OnTraversingGrillID2;
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 7).OnTraversingEmancipationGrill += OnTraversingGrillID7;
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 9).OnTraversingEmancipationGrill += OnTraversingGrillID9;

            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 2).AssignTrigger(triggers.Find(t => t.Name.Contains("Button") && t.ID == 2));
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 3).AssignTrigger(triggers.Find(t => t.Name.Contains("Button") && t.ID == 1));
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 5).AssignTrigger(triggers.Find(t => t.Name.Contains("Button") && t.ID == 4));
            triggeredObjs.Find(c => c.Name.Contains("Grill") && c.ID == 8).AssignTrigger(triggers.Find(t => t.Name.Contains("Button") && t.ID == 4));

            buttonID2      = (TopDownHeavyDutySuperCollidingSuperButton)triggers.Find(t => t.Name.Contains("Button") && t.ID == 2);
            buttonID3      = (TopDownHeavyDutySuperCollidingSuperButton)triggers.Find(t => t.Name.Contains("Button") && t.ID == 3);
            victoryTrigger = (VictoryTrigger)triggers.Find(t => t.Name.Contains("VictoryTrigger"));
        }
Esempio n. 2
0
        private void AssignTriggers()
        {
            List <TopDownTriggerableObject> triggerableObj = new List <TopDownTriggerableObject>();
            List <TopDownTrigger>           triggers       = new List <TopDownTrigger>();

            foreach (var item in addedGameObjects)
            {
                if (item is TopDownTrigger)
                {
                    triggers.Add((TopDownTrigger)item);
                }
                if (item is TopDownTriggerableObject)
                {
                    triggerableObj.Add((TopDownTriggerableObject)item);
                }
            }
            triggerableObj.Find(c => c.Name.Contains("Grill") && c.ID == 1).AssignTrigger(triggers.Find(t => t.Name.Contains("Button") && t.ID == 2));
            respawnButton = (TopDownHeavyDutySuperCollidingSuperButton)triggers.Find(t => t.Name.Contains("Button") && t.ID == 1);
        }