Esempio n. 1
0
        protected void Awake()
        {
            _state    = State.WaitToMove;
            _rotation = transform.rotation.eulerAngles.y;

            if (_startWithFuse)
            {
                _fuseObject = Instantiate(_fusePrefab);
                _fuseObject.transform.parent   = transform;
                _fuseObject.transform.position = _fuseLocation.position;
                _fuseObject.transform.rotation = _fuseLocation.rotation;
                _fuseObject.transform.Rotate(Vector3.right * 90, Space.Self);

                HeroTrigger trigger = GetComponentInChildren <HeroTrigger>();
                trigger.OnStartInteract    += HandleStartInteract;
                trigger.OnHeroEnterTrigger += HandleHeroEnterTrigger;
                trigger.OnHeroExitTrigger  += HandleHeroExitTrigger;
            }

            _fuseLocation.gameObject.SetActive(false);

            if (_disabled)
            {
                FallOver();
            }
        }
        protected void Awake()
        {
            Instance       = this;
            _poweredLights = new List <PoweredLight>();
            HeroTrigger _trigger = GetComponentInChildren <HeroTrigger>();

            _trigger.OnStartInteract    += HandleHeroInteract;
            _trigger.OnHeroEnterTrigger += HandleHeroEnterTrigger;
            _trigger.OnHeroExitTrigger  += HandleHeroExitTrigger;
        }
Esempio n. 3
0
        protected void Awake()
        {
            _trigger = GetComponentInChildren <HeroTrigger>();
            _trigger.OnStartInteract += HandleStartInteract;
            _fuseStation              = GetComponentInParent <FuseStation>();
            _actualGearAxis.position  = _gearAxis.position;
            _gearAxis.parent          = _actualGearAxis;
            _wrenchAxis.position      = _wrench.position;
            _wrench.parent            = _wrenchAxis;

            _trigger.OnHeroEnterTrigger += HandleHeroEnterTrigger;
            _trigger.OnHeroExitTrigger  += HandleHeroExitTrigger;
        }
 protected void Awake()
 {
     _heroTrigger = GetComponent <HeroTrigger>();
     _heroTrigger.OnAutoTrigger += HandleAutoTrigger;
 }