コード例 #1
0
    void Start()
    {
        attackZone = GetComponentInChildren <AttackZone>();
        attackZone.SetRadius(attackRadius);

        InitializeTimer();

        EventManager.AddPauseTimeListener(Pause);
        EventManager.AddTimeChangeListener(GoToTime);
        EventManager.AddReachedFinishListener(OnTargetLeft);
        EventManager.AddUnitDeadListener(OnTargetLeft);
    }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: fsolanet5811/Revenant
    protected virtual void Awake()
    {
        // The id will identify the enemy in the scene.
        Id = new EnemyId(transform.position);

        // Awake gets called immediately when instantiating a Unity object in the scene.
        // We set the persistence here so that anything that instantiates this can change it in the same frame.
        IsPersistent = true;

        _animator       = new EnemyAnimator(GetComponent <Animator>());
        _attackZone     = GetComponentInChildren <AttackZone>();
        _rigidBody      = GetComponent <Rigidbody2D>();
        _physicalHitBox = GetComponent <Collider2D>();
    }
コード例 #3
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }



        _rb   = GetComponent <Rigidbody>();
        zone  = attackZone.GetComponent <AttackZone>();
        Izone = InteractZone.GetComponent <InteractionZone>();
        InteractSprite.SetActive(false);
        attackZone.SetActive(false);
        Hud.TransiOut();
    }
コード例 #4
0
ファイル: Enemy.cs プロジェクト: T4g1/jamcraft4
 public float GetAttackRange()
 {
     return(AttackZone.GetRadius());
 }