Ejemplo n.º 1
0
Archivo: Main.cs Proyecto: n1ron/Unity2
        private void Awake()
        {
            Instance = this;

            MainCamera = Camera.main.transform;
            Player     = GameObject.FindGameObjectWithTag("Player").transform;

            Inventory = new Inventory();

            PlayerController = new PlayerController(new UnitMotor(
                                                        GameObject.FindObjectOfType <CharacterController>().transform));
            FlashLightController = new FlashLightController();
            InputController      = new InputController();
            WeaponController     = new WeaponController();
            SelectionController  = new SelectionController();
            BotController        = new BotController();

            _controllers    = new IOnUpdate[6];
            _controllers[0] = FlashLightController;
            _controllers[1] = InputController;
            _controllers[2] = PlayerController;
            _controllers[3] = WeaponController;
            _controllers[4] = SelectionController;
            _controllers[5] = BotController;
        }
Ejemplo n.º 2
0
Archivo: Main.cs Proyecto: n1ron/Unity2
 private void Start()
 {
     Inventory.OnStart();
     FlashLightController.OnStart();
     PlayerController.On();
     InputController.On();
     BotController.CountBot = _botCount;
     BotController.Spawner  = _spawnPoint;
     BotController.OnStart();
     BotController.On();
 }
Ejemplo n.º 3
0
        void Start()
        {
            Instance = this;



            _controllersGameObject = new GameObject {
                name = "Controllers"
            };



            _inputController = _controllersGameObject.AddComponent <InputController>();

            _flashlightController = _controllersGameObject.AddComponent <FlashlightController>();

            _markController = _controllersGameObject.AddComponent <MarkController>();

            _weaponsController = _controllersGameObject.AddComponent <WeaponController>();

            _botController = _controllersGameObject.AddComponent <BotController>();

            _objectManager = GetComponent <ObjectManager>();
        }