Ejemplo n.º 1
0
        private void Start()
        {
            _actorController = Utils.InterfaceHelper.GetInterfaceComponent <IActorController>(this);

            if (_actorController == null)
            {
                Debug.LogError("No IActorController found");
                gameObject.SetActive(false);
                return;
            }

            if (_actorController.isLocalPlayer)
            {
                OnEnable();
            }

            _camera = FindObjectOfType <CameraBehavior>();

            if (_camera == null)
            {
                Debug.LogError("No CameraBehavior found");
                return;
            }

            if (_actorController.isLocalPlayer)
            {
                _camera.SetTarget(this.transform);
            }

            OnStart();
        }