public void Init(ObjectiveConfiguration configuration) { _configuration = configuration; name = "Objective : " + configuration.Object.name; transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>().sprite = configuration.FeedbackSprite; transform.GetChild(0).GetChild(0).localScale = Vector3.one * configuration.SpriteScale; }
public override ObjectiveConfiguration GetDefaultObjectiveConfiguration(Trigger trigger) { ObjectiveConfiguration result = new ObjectiveConfiguration(); if (trigger) { var triggerType = trigger.GetType(); if (triggerType == typeof(PickupTrigger)) { result.Title = "Don't Pickup the Pickups!"; result.Description = "Don't do it!"; result.ProgressType = ObjectiveProgressType.Amount; } else if (triggerType == typeof(TouchTrigger)) { result.Title = "Don't Touch the Object"; result.Description = "You can't touch this!"; } else if (triggerType == typeof(NearbyTrigger)) { result.Title = "Avoid the Object"; result.Description = "Avoid it!"; } else if (triggerType == typeof(TimerTrigger)) { result.Title = "Finish Before the Time is Up"; result.Description = "Hurry up!"; result.ProgressType = ObjectiveProgressType.Time; } else if (triggerType == typeof(RandomTrigger)) { result.Title = "Finish Before a Random Time is Up"; result.Description = "Hurry up!"; } else if (triggerType == typeof(InputTrigger)) { result.Title = "Don't Press the Button"; result.Description = "Don't push it"; } else if (triggerType == typeof(CounterTrigger)) { result.Title = "Don't Complete the Objective"; result.Description = "Don't do it!"; } else { result.Title = "Don't Complete the Objective"; result.Description = "Don't do it!"; } } else { result.Title = "Didn't Stand a Chance!"; result.Description = "Connect a Trigger Brick to the Lose Brick to make your game easier."; } result.Lose = true; return(result); }
public override ObjectiveConfiguration GetDefaultObjectiveConfiguration(Trigger trigger) { ObjectiveConfiguration result = new ObjectiveConfiguration(); if (trigger) { var triggerType = trigger.GetType(); if (triggerType == typeof(PickupTrigger)) { result.Title = "Collect all the Pickups"; result.Description = "Go get 'em!"; result.ProgressType = ObjectiveProgressType.Amount; } else if (triggerType == typeof(TouchTrigger)) { result.Title = "Touch the Object"; result.Description = "Touch it!"; } else if (triggerType == typeof(NearbyTrigger)) { result.Title = "Get to the Object"; result.Description = "Get there!"; } else if (triggerType == typeof(TimerTrigger)) { result.Title = "Survive"; result.Description = "Hang in there!"; result.ProgressType = ObjectiveProgressType.Time; } else if (triggerType == typeof(RandomTrigger)) { result.Title = "Survive for a Random Time"; result.Description = "Hang in there!"; } else if (triggerType == typeof(InputTrigger)) { result.Title = "Press the Button"; result.Description = "Push it!"; } else if (triggerType == typeof(CounterTrigger)) { result.Title = "Complete the Objective"; result.Description = "Just do it!"; } else { result.Title = "Complete the Objective"; result.Description = "Just do it!"; } } else { result.Title = "Easy as Pie!"; result.Description = "Connect a Trigger Brick to the Win Brick to make this objective more challenging."; } return(result); }
public void OpenScroll(ObjectiveConfiguration configuration) { if (Scrollcontent.childCount != 0) { Destroy(Scrollcontent.GetChild(0).gameObject); } Instantiate(configuration.ScrollInfos, Scrollcontent); ScrollAnimator.SetBool("Show", true); }
private void SpawnRandomObjective() { int rndIndex = Random.Range(0, _levelConfiguration.Objectives.Count); ObjectiveConfiguration config = _levelConfiguration.Objectives[rndIndex]; ObjectiveManager.SpawnObjective(config); /*ObjectFactory objFactory = ObjectFactory.Instance; * foreach (StockItemConfiguration itemConfiguration in _levelConfiguration.ItemsInStock) * objFactory.GenerateObject(InputGridSystem, itemConfiguration.Position, itemConfiguration.Object);*/ _nextSpawn = _currentRespawnTime; }
public bool SpawnObjective(ObjectiveConfiguration configuration) { foreach (ObjectiveSlot slot in ObjectivesSlots) { if (slot.Occupied) { continue; } GameObject feedbackGo = Instantiate(ObjectiveFeedbackPrefab, transform); ObjectiveFeedback of = feedbackGo.GetComponent <ObjectiveFeedback>(); of.Init(configuration); feedbackGo.transform.position = transform.position + new Vector3(slot.Position.x, slot.Position.y); slot.Configuration = configuration; slot.Occupied = true; slot.Feedback = of; ++ActiveObjectives; return(true); } return(false); }