Beispiel #1
0
    public void Awake()
    {
        _dynamicGameObjects      = GameObjectEx.Find(GameObjectNames.DynamicObjects);
        _playerGameObject        = GameObjectEx.FindGameObjectWithTag(GameObjectTags.Player);
        _toMoveDirectionRotation = GetComponent <ToMoveDirectionRotation>();
        _toTargetObjectRotation  = GetComponent <ToTargetObjectRotation>();

        var shadowLayer = Layers.GetLayer(LayerName.ShadowLayer);

        _layerMask     = (1 << shadowLayer) | (1 << Layers.GetLayer(LayerName.Player));
        _moveScript    = GetComponent <MoveScript>();
        _weaponManager = GetComponentInChildren <WeaponManager>();

        if (_weaponManager == null)
        {
            Debug.LogError("Weapon manager not found in child objects.");
        }
    }
Beispiel #2
0
 public void Awake()
 {
     _id = gameObject.GetInstanceID();
     _weaponStateMachine = new WeaponStateMachine(WeaponCooldown, 0);
     _dynamicGameObjects = GameObjectEx.Find(GameObjectNames.DynamicObjects);
 }