Exemplo n.º 1
0
 public void Activate(TriggerHandler.TriggerType triggerProps, SpawnType spawnTf)
 {
     base.Activate(transform, spawnTf);
     EventType  = triggerProps.EventType;
     EventId    = triggerProps.EventId;
     PausesGame = triggerProps.PausesGame;
     Trigger.Collider.enabled = true;
     gameObject.GetComponent <SpriteRenderer>().enabled = Toolbox.Instance.Debug;
     _waitType = PausesGame ? TooltipHandler.WaitType.InGamePause : TooltipHandler.WaitType.InGameNoPause;
 }
Exemplo n.º 2
0
    private void StoreTriggers()
    {
        var triggerCounts = GetObjCounts(_triggerParent);

        for (int i = 0; i < _numSections; i++)
        {
            Level.Caves[i].Triggers = new TriggerHandler.TriggerType[triggerCounts[i]];
        }

        int[] triggerNum = new int[_numSections];
        foreach (Transform trigger in _triggerParent)
        {
            int index = Mathf.RoundToInt(trigger.position.x / _tileSizeX);

            TriggerHandler.TriggerType newTrigger = Level.Caves[index].Triggers[triggerNum[index]];
            newTrigger.SpawnTransform = ProduceSpawnTf(trigger, index);
            newTrigger.EventId        = trigger.GetComponent <TriggerClass>().EventId;
            newTrigger.EventType      = trigger.GetComponent <TriggerClass>().EventType;
            newTrigger.PausesGame     = trigger.GetComponent <TriggerClass>().PausesGame;
            Level.Caves[index].Triggers[triggerNum[index]] = newTrigger;
            triggerNum[index]++;
        }
    }