Ejemplo n.º 1
0
        public Camera(int horizontalSize, int verticalSize, float fieldOfView, IRayProvider _rayProvider)
        {
            this._rayProvider = _rayProvider;
            Width             = horizontalSize;
            Height            = verticalSize;
            FieldOfView       = fieldOfView;

            Transform = Matrix.Identity;

            var halfView = MathF.Tan(fieldOfView / 2);
            var aspect   = (float)horizontalSize / verticalSize;

            if (aspect >= 1)
            {
                HalfWidth  = halfView;
                HalfHeight = halfView / aspect;
            }
            else
            {
                HalfWidth  = halfView * aspect;
                HalfHeight = halfView;
            }

            PixelSize = HalfWidth * 2 / horizontalSize;
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     _selectionResponse    = GetComponent <ISelectionResponse>();
     _selector             = GetComponent <ISelector>();
     _rayProvider          = GetComponent <IRayProvider>();
     _CombinableSelections = new List <Transform>();
 }
Ejemplo n.º 3
0
 void Awake()
 {
     _rayProvider = GetComponent <IRayProvider>();
     _fireInput   = GetComponent <IFireInput>();
     _mouseLook   = GetComponent <IMouseLook>();
     _movement    = GetComponent <IMovement>();
 }
 private void Start()
 {
     navMeshAgent = GetComponent <NavMeshAgent>();
     rayProvider  = GetComponent <IRayProvider>();
     selector     = GetComponent <ISelector>();
     animator     = GetComponent <Animator>();
 }
Ejemplo n.º 5
0
 private void Awake()
 {
     _rayProvider       = GetComponent <IRayProvider>();
     _selector          = GetComponent <ISelector>();
     _selectionResponse = GetComponent <ISelectionResponse>();
     _clickResponse     = GetComponent <IClickResponse>();
     _hoverResponse     = GetComponent <IHoverResponse>();
 }
Ejemplo n.º 6
0
 private void Awake()
 {
     _rayProvider               = GetComponent <IRayProvider>();
     _inputProvider             = GetComponent <InputProvider>();
     _bulletFlashParticleSystem = GetComponentInChildren <ParticleSystem>();
     _weapon.CurrentAmmoInClip  = _weapon.MaxAmmoInClip;
     _weapon.CurrentAmmo        = _weapon.maxAmmo;
     AmmoUI();
 }
Ejemplo n.º 7
0
 public Scene(ICameraProvider cameraProvider, IRayProvider rayProvider, ISceneConfigProvider configProvider,
              IObjectContainer container, IImageWriter writer, ILightningSourceProvider lightningProvider)
 {
     _cameraProvider    = cameraProvider;
     _configProvider    = configProvider;
     _rayProvider       = rayProvider;
     _objContainer      = container;
     _imageWriter       = writer;
     _lightningProvider = lightningProvider;
 }
Ejemplo n.º 8
0
        //[SerializeField] private ThingRuntimeSet allWorldObjects;

        //[SerializeField] private List<RecipeType> allCraftRecipes = new List<RecipeType>();

        #endregion

        #region MonoBehavior Functions

        private void Awake()
        {
            //DelegateManager.connectedTowers = _connectedTowers;

            _rayProvider         = GetComponent <IRayProvider>();
            _selector            = GetComponent <ISelector>();
            _clickResponse       = GetComponent <IClickable>();
            _doubleClickResponse = GetComponent <IDoubleClickable>();

            DelegateManager.infoPanel = _infoPanel;
        }
Ejemplo n.º 9
0
    Transform selection; // The last object that inters
    // Start is called before the first frame update
    void Start()
    {
        cam      = Camera.main;
        dragging = false;

        rayProvider     = GetComponent <IRayProvider>();
        selector        = GetComponent <ISelector>();
        selectionShader = Shader.Find("Unlit/Outline");
        standardShader  = Shader.Find("Standard");
        SessionEvents.current.OnCutModeEnable  += CutEnable;
        SessionEvents.current.OnCutModeDisable += CutDisable;
    }
Ejemplo n.º 10
0
    void Start()
    {
        SessionEvents.current.OnSelectionClear  += ClearSelection;
        SessionEvents.current.OnCutModeEnable   += CutEnable;
        SessionEvents.current.OnCutModeDisable  += CutDisable;
        SessionEvents.current.onModelUnLoaded   += removeFromSelection;
        SessionEvents.current.OnItemDragAny     += DisableBoxSelection;
        SessionEvents.current.OnItemDragStopAny += EnableBoxSelection;

        selected        = new List <string>();
        rayProvider     = GetComponent <IRayProvider>();
        selector        = GetComponent <ISelector>();
        selectionShader = Shader.Find("Unlit/Outline");
        standardShader  = Shader.Find("Standard");
    }
Ejemplo n.º 11
0
    public void Initialize(GameController puzzleController)
    {
        //puzzle
        this.PuzzleController = puzzleController;
        this.PuzzleTransform  = GameObject.Find("Puzzle").transform;

        //board
        this.BoardTransform = this.PuzzleTransform.Find("Board").transform;

        //ray provider, selectors and responses
        this.RayProvider            = this.GetComponent <IRayProvider>();
        this.TransformSelector      = this.GetComponent <ITransformSelector>();
        this.BoardCoordSelector     = this.GetComponent <ICoordSelector>();
        this.PieceSelectionResponse = this.GetComponent <IPieceSelectionResponse>();
        this.BoardSelectionResponse = this.GetComponent <IBoardSelectionResponse>();
    }
Ejemplo n.º 12
0
    protected virtual void Awake()
    {
        _layerMaskGround = LayerMask.GetMask("Ground");

        _camera                 = Camera.main;
        _navMeshAgent           = GetComponent <NavMeshAgent>();
        _animator               = GetComponentInChildren <Animator>();
        _mouseScreenRayProvider = GetComponent <IRayProvider>();
        _highlightSelection     = GetComponent <ISelection>();
        _coinSelector           = GetComponent <ISelector>();

        Assert.IsNotNull(_camera, "Camera Component not initialized.");
        Assert.IsNotNull(_navMeshAgent, "NavMeshAgent Component not initialized.");
        Assert.IsNotNull(_animator, "Animator Component not initialized.");
        Assert.IsNotNull(_mouseScreenRayProvider, "MouseScreenRayProvider Component not initialized.");
        Assert.IsNotNull(_highlightSelection, "HighlightSelectionManager Component not initialized.");
        Assert.IsNotNull(_coinSelector, "RayCastCoinSelector Component not initialized.");
    }
Ejemplo n.º 13
0
 private void Construct(PhysicsCache physicsCache,
                        EventManager eventManager,
                        IRayProvider rayProvider,
                        ISelector2D selector,
                        IPieceProvider pieceProvider,
                        IGameFinisher gameFinisher,
                        IPhaseManager phaseManager,
                        ITurnManager turnManager,
                        IMovementValidator movementValidator)
 {
     _physicsCache      = physicsCache;
     _eventManager      = eventManager;
     _rayProvider       = rayProvider;
     _selector          = selector;
     _pieceProvider     = pieceProvider;
     _gameFinisher      = gameFinisher;
     _phaseManager      = phaseManager;
     _turnManager       = turnManager;
     _movementValidator = movementValidator;
 }
Ejemplo n.º 14
0
 private void Construct(PhysicsCache physicsCache,
                        EventManager eventManager,
                        IRayProvider rayProvider,
                        ISelector selector,
                        IFieldProvider fieldProvider,
                        IPieceProvider pieceProvider,
                        ICaptureVerifier captureVerifier,
                        IGameFinisher gameFinisher,
                        IPhaseManager phaseManager,
                        ITurnManager turnManager,
                        IWallVerifier wallVerifier)
 {
     _physicsCache    = physicsCache;
     _eventManager    = eventManager;
     _rayProvider     = rayProvider;
     _selector        = selector;
     _fieldProvider   = fieldProvider;
     _pieceProvider   = pieceProvider;
     _captureVerifier = captureVerifier;
     _gameFinisher    = gameFinisher;
     _phaseManager    = phaseManager;
     _turnManager     = turnManager;
     _wallVerifier    = wallVerifier;
 }
 private void Awake()
 {
     _selectionResponse = GetComponent <ISelectionResponse>();
     _rayProvider       = GetComponent <IRayProvider>();
     _selector          = GetComponent <ISelector>();
 }
Ejemplo n.º 16
0
 void Start()
 {
     ammo        = new magazineBehaviour(magezineSize.Value, ammoInMag.Value, amountOfBullets.Value);
     rayProvider = GetComponent <IRayProvider>(); //dit called het midden van het scherm
     selector    = GetComponent <ISelector>();    // maakt de ray die ervoor zorgt dat je de enemy raakt
 }
Ejemplo n.º 17
0
 private void Awake()
 {
     _RayProvider       = GetComponent <IRayProvider>();
     _selector          = GetComponent <ISelector>();
     _selectionresponse = GetComponent <IHave_Selection_Response>();
 }
Ejemplo n.º 18
0
 private void Awake()
 {
     _rayProvider = GetComponent <IRayProvider>();
     _weapon.CurrentAmmoInClip = _weapon.MaxAmmoInClip;
     _weapon.CurrentAmmo       = _weapon.maxAmmo;
 }
Ejemplo n.º 19
0
 public CameraProvider(IRayProvider rayProvider)
 {
     this._rayProvider = rayProvider;
 }
Ejemplo n.º 20
0
 public KdTreeRenderer(IProgressBar progressBar, IStopwatch stopwatch, IRayProvider rayProvider)
 {
     this.progressBar = progressBar;
     this.stopwatch   = stopwatch;
     this.rayProvider = rayProvider;
 }
Ejemplo n.º 21
0
 private void Awake()
 {
     _rayProvider = GetComponent <IRayProvider>();
     _targeter    = GetComponent <ITargeter>();
 }
Ejemplo n.º 22
0
 private void Awake()
 {
     rayProvider = GetComponent <IRayProvider>();
     selector    = GetComponent <ISelector>();
 }
Ejemplo n.º 23
0
 private void Awake()
 {
     _rayProvider     = GetComponent <IRayProvider>();
     _finder          = GetComponent <IFinder>();
     _findingResponse = GetComponent <IFindingResponse>();
 }