Exemple #1
0
 public void Activate(Vector3[] points, bool finalShot)
 {
     isDissipating      = finalShot;
     line.positionCount = points.Length + (int)Mathf.Pow(2, lineRes) - 1;
     line.SetPositions(ShotsManager.TessLine(points, lineRes));
     Activate();
 }
    private void Awake()
    {
        // Dont destroy this object when a new scene is loaded, unless...
        DontDestroyOnLoad(this);

        // There can be only ONE!
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(this.gameObject);
        }

        // Populate shot class with information from active film, i.e. actors, location.
        // build out the shot types in the inspector

        // Get the current film in production
        Film currentFilm = FilmManager.Instance.preProductionFilm.GetComponent <Film>();

        foreach (shot s in shotOptions)
        {
            s.shotLocationID = currentFilm.filmLocations[1];
        }
    }
Exemple #3
0
        public Arsenal(int ownerId, Navigation navigation, UnitTargeting targeting, Following following, Partset partset, ShotsManager shotsManager, TimeManager timeManager)
        {
            _ownerId      = ownerId;
            _shotsManager = shotsManager;
            _timeManager  = timeManager;
            _targeting    = targeting;
            _navigation   = navigation;
            _following    = following;
            _partset      = partset;

            _partset.OnPartAttached += OnPartAttached;
            _partset.OnPartDetached += OnPartDetached;

            _targeting.OnTargetChange += OnTargetChange;
        }
    void Awake()
    {
        score       = GameObject.Find("Score").GetComponent <Text>();
        points      = GameObject.Find("Points").GetComponent <Text>();
        firstBonus  = GameObject.Find("MissilePoints").GetComponent <Text>();
        secondBonus = GameObject.Find("CitiesPoints").GetComponent <Text>();

        bonusText = GameObject.Find("BonusText");
        bonusText.SetActive(false);

        endText = GameObject.Find("EndText");
        endText.SetActive(false);

        arrowsAnim = GameObject.Find("Cities").GetComponent <Animator>();

        enemiesManager = GameObject.Find("EnemiesManager").GetComponent <EnemiesManager>();
        shotsManager   = GameObject.Find("ShotsManager").GetComponent <ShotsManager>();
    }
Exemple #5
0
        protected override void Awake()
        {
            base.Awake();

            GameSettings = GameSettings.Instance;

            UnitObjectManager = GameObject.FindObjectOfType <UnitObjectManager>();
            UnitViewManager   = GameObject.FindObjectOfType <UnitViewManager>();
            InputManager      = GameObject.FindObjectOfType <InputManager>();
            PartViewsManager  = GameObject.FindObjectOfType <PartViewsManager>();
            ShotViewsManager  = GameObject.FindObjectOfType <ShotViewsManager>();

            UnitManager         = new UnitManager();
            PartsManager        = new PartsManager();
            TimeManager         = new TimeManager();
            SelectionManager    = new SelectionManager();
            CommandManager      = new CommandManager();
            InputContextManager = new InputContextManager();
            PlayerManager       = new PlayerManager();
            VisibilityManager   = new VisibilityManager();
            ShotsManager        = new ShotsManager();

            _managers[UnitManager.ManagerType]         = UnitManager;
            _managers[UnitViewManager.ManagerType]     = UnitViewManager;
            _managers[UnitObjectManager.ManagerType]   = UnitObjectManager;
            _managers[InputManager.ManagerType]        = InputManager;
            _managers[SelectionManager.ManagerType]    = SelectionManager;
            _managers[CommandManager.ManagerType]      = CommandManager;
            _managers[TimeManager.ManagerType]         = TimeManager;
            _managers[InputContextManager.ManagerType] = InputContextManager;
            _managers[PlayerManager.ManagerType]       = PlayerManager;
            _managers[VisibilityManager.ManagerType]   = VisibilityManager;
            _managers[ShotsManager.ManagerType]        = ShotsManager;
            _managers[ShotViewsManager.ManagerType]    = ShotViewsManager;
            _managers[PartsManager.ManagerType]        = PartsManager;
            _managers[PartViewsManager.ManagerType]    = PartViewsManager;

            foreach (var manager in _managers.Values)
            {
                manager.Init();
            }
        }
Exemple #6
0
        public void Init(int ownerId, Vector3 slotOffset, UnitTargeting unitTargeting, Navigation navigation, ShotsManager shotsManager, TimeManager timeManager)
        {
            _slotOffset = slotOffset;
            _ownerId    = ownerId;
            _navigation = navigation;

            _timeManager  = timeManager;
            _shotsManager = shotsManager;

            Targeting    = new Targeting(unitTargeting);
            Reloader     = new Reloader(timeManager);
            Shooter      = new Shooter(timeManager);
            Aimer        = new Aimer(_navigation, Targeting, _timeManager);
            TargetFinder = new TargetFinder(Targeting, Aimer, _navigation, Range, _ownerId);

            Reloader.OnReloadingFinish += OnReloadingFinish;
            Shooter.OnShootingFinished += OnShootingFinished;
            Aimer.OnAimed   += OnAimed;
            Shooter.OnShoot += OnShoot;
        }