Exemple #1
0
    private void Start()
    {
        EventMessenger.Subscribe(GameEvent.StartGameProcess, this, OnStartGameProcess);
        EventMessenger.Subscribe(GameEvent.InvokeAdjuster, this, StopAnyActivity);
        EventMessenger.Subscribe(GameEvent.EngGameProcess, this, StopAnyActivity);

        _pathFinderMovement = this.GetInterfaceComponent<IPathFinderMovement>();
        if (_pathFinderMovement == null)
        {
            Debug.LogError("_pathFinderMovement=null", this);
            return;
        }
        _pathFinderMovement.OnWaypointChange = RotateShape;

        _directMovement = this.GetInterfaceComponent<ISimpleMovement>();
        if (_directMovement == null)
        {
            Debug.LogError("_directMovement=null", this);
            return;
        }

        _animator = GetComponentInChildren<Animator>();
        if (_animator == null)
        {
            Debug.LogError("_animator=null", this);
            return;
        }

        _rndPlayAudio = GetComponentInChildren<RandomPlayAudio>();
        if (_rndPlayAudio == null)
        {
            Debug.LogError("_rndPlayAudio=null", this);
            return;
        }

        _waitTime = 180;
    }
    private void Start()
    {
        EventMessenger.Subscribe(GameEvent.StartGameProcess, this, OnStartGameProcess);
        EventMessenger.Subscribe(GameEvent.InvokeAdjuster, this, StopAnyActivity);
        EventMessenger.Subscribe(GameEvent.EngGameProcess, this, StopAnyActivity);

        _pathFinderMovement = this.GetInterfaceComponent <IPathFinderMovement>();
        if (_pathFinderMovement == null)
        {
            Debug.LogError("_pathFinderMovement=null", this);
            return;
        }
        _pathFinderMovement.OnWaypointChange = RotateShape;

        _directMovement = this.GetInterfaceComponent <ISimpleMovement>();
        if (_directMovement == null)
        {
            Debug.LogError("_directMovement=null", this);
            return;
        }

        _animator = GetComponentInChildren <Animator>();
        if (_animator == null)
        {
            Debug.LogError("_animator=null", this);
            return;
        }

        _rndPlayAudio = GetComponentInChildren <RandomPlayAudio>();
        if (_rndPlayAudio == null)
        {
            Debug.LogError("_rndPlayAudio=null", this);
            return;
        }

        _waitTime = 180;
    }
Exemple #3
0
 private void Start()
 {
     _spriteChanger = GetComponent<SpriteChanger>();
     _randomPlayAudio = GetComponent<RandomPlayAudio>();    
     enabled = false;
 }
 private void Start()
 {
     _spriteChanger   = GetComponent <SpriteChanger>();
     _randomPlayAudio = GetComponent <RandomPlayAudio>();
     enabled          = false;
 }