Пример #1
0
        public void Update()
        {
            if (_pause || _gameover)
            {
                return;
            }

            if (_pendingStart)
            {
                TechList.Clear();
                GeneralList.Clear();
                ListeningDevList.Clear();
                TechList.AddRange(GameObject.FindGameObjectsWithTag("Player"));
                GeneralList.AddRange(GameObject.FindGameObjectsWithTag("General"));
                ListeningDevList.AddRange(GameObject.FindGameObjectsWithTag("ListeningDevice"));
                CurrentObjective = GameObject.FindObjectOfType <Objective>();
                ActiveTech       = TechList[0];
                SoundManager.Instance().Camera      = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
                SoundManager.Instance().MusicSource = SoundManager.Instance().Camera.gameObject.AddComponent <AudioSource>();
                _fundingText = GameObject.FindGameObjectsWithTag("FundingText")[0].GetComponent <Text>();
                AITaskManager.GeneralsAwaitingConversation.Clear();
                _pendingStart = false;
            }

            if (ActiveTech == null && TechList.Count > 0)
            {
                ActiveTech = TechList[0];
            }

            InputManager.Instance().Update();
            AITaskManager.Instance().Update(GeneralList);
            CurrentObjective.pevent = Objective.Event;
            CurrentObjective.pplace = Objective.Place;
            CurrentObjective.ptime  = Objective.Time;

            if (_dailyManager.TransitioningDay == false && Timer.Instance().GetRemainingTime() <= 0)
            {
                _dailyManager.EndDay();
                //CallGameover();
                displayGameover();
            }

            if (Input.GetKeyUp(KeyCode.Tab) && _usingDesk == false)
            {
                CycleTech();
            }

            if (FundingAmount < 0)
            {
                FundingAmount = 0;
            }
        }
Пример #2
0
        private void Start()
        {
            inputManager = InputManager.Instance();
            character    = technician.GetComponent <Character2D>();
            _Camera      = GameObject.FindGameObjectWithTag("MainCamera");
            lineRenderer = gameObject.AddComponent <LineRenderer>();

            /* line is purple, i don't know why, i think it is lacking a materia?
             * lineRenderer.startColor = Color.blue;
             * lineRenderer.endColor = Color.green;
             */
            lineRenderer.widthMultiplier = 0.05f;
            lineRenderer.positionCount   = 2;
            CanvasHireFire = RadialMenuSpawner.ins.CanvasHireFire;
        }
Пример #3
0
 private void AwakeSingletonManagers()
 {
     SoundManager.Instance();
     InputManager.Instance();
     AITaskManager.Instance();
 }
Пример #4
0
 public void Awake()
 {
     Animator      = GetComponent <Animator>();
     _inputManager = InputManager.Instance();
     Tasks         = new AIStack();
 }