public virtual void Awake() { Debug.Log("Base Scene Controller Awake"); MessageInterface = new QdmsMessageInterface(this.gameObject); MessageInterface.SubscribeReceiver((m) => HandleMessage(m)); Current = this; if (AutoinitUi) { InitUI(); } if (AutoinitHud) { InitHUD(); } //mostly an editor hack if (AutoinitState && !GameState.Instance.InitialLoaded) { GameState.LoadInitial(); } }
private void Start() { MessageInterface = new QdmsMessageInterface(this.gameObject); MessageInterface.SubscribeReceiver(HandleMessageReceived); SetStateFromConfig(); }
private void Awake() { MessageInterface = new QdmsMessageInterface(this.gameObject); MessageInterface.SubscribeReceiver(HandleMessage); }
private void Awake() { MessageInterface = new QdmsMessageInterface(this); Current = this; }
public override void Start() { base.Start(); Debug.Log("Player controller start"); if (!CameraRoot) { CameraRoot = transform.Find("CameraRoot"); } if (!ModelRoot) { ModelRoot = transform.GetChild(0).gameObject; } if (!MovementComponent) { MovementComponent = GetComponent <PlayerMovementComponent>(); } if (!WeaponComponent) { WeaponComponent = GetComponentInChildren <PlayerWeaponComponent>(); } if (!CameraZoomComponent) { CameraZoomComponent = GetComponentInChildren <PlayerCameraZoomComponent>(true); } if (!DeathComponent) { DeathComponent = GetComponentInChildren <PlayerDeathComponent>(); } if (!ShieldComponent) { ShieldComponent = GetComponent <PlayerShieldComponent>(); } if (!HUDScript) { HUDScript = (RpgHUDController)BaseHUDController.Current; //I would not recommend this cast } if (!HUDScript && AutoinitHud) { Instantiate <GameObject>(CoreUtils.LoadResource <GameObject>("UI/DefaultWorldHUD"), CoreUtils.GetUIRoot()); if (EventSystem.current == null) { Instantiate(CoreUtils.LoadResource <GameObject>("UI/DefaultEventSystem")); } HUDScript = (RpgHUDController)BaseHUDController.Current; } MessageInterface = new QdmsMessageInterface(gameObject); LockPauseModule.CaptureMouse = true; SetDefaultPlayerView(); SetInitialViewModels(); ShieldComponent.Ref()?.HandleLoadStart(); }
private void Awake() { MessageInterface = new QdmsMessageInterface(gameObject); MessageInterface.KeepMessagesInQueue = false; MessageInterface.SubscribeReceiver(HandleMessageReceived); }
public override void Start() { base.Start(); Debug.Log("Player controller start"); if (!CameraRoot) { CameraRoot = transform.Find("CameraRoot"); } if (!ModelRoot) { ModelRoot = transform.GetChild(0).gameObject; } if (!MovementComponent) { MovementComponent = GetComponent <PlayerMovementComponent>(); } if (!WeaponComponent) { WeaponComponent = GetComponentInChildren <PlayerWeaponComponent>(); } if (!CameraZoomComponent) { CameraZoomComponent = GetComponentInChildren <PlayerCameraZoomComponent>(true); } if (!DeathComponent) { DeathComponent = GetComponentInChildren <PlayerDeathComponent>(); } if (!ShieldComponent) { ShieldComponent = GetComponent <PlayerShieldComponent>(); } if (LightReportingComponent == null) { LightReportingComponent = GetComponentInChildren <IReportLight>() as MonoBehaviour; } if (!HUDScript) { HUDScript = SharedUtils.TryGetHudController() as RpgHUDController; } if (!HUDScript && AutoinitHud) { Instantiate <GameObject>(CoreUtils.LoadResource <GameObject>("UI/DefaultWorldHUD"), CoreUtils.GetUIRoot()); if (EventSystem.current == null) { Instantiate(CoreUtils.LoadResource <GameObject>("UI/DefaultEventSystem")); } HUDScript = SharedUtils.TryGetHudController() as RpgHUDController; if (HUDScript == null) { Debug.LogError("[PlayerController] Failed to initialize HUD properly"); } } MessageInterface = new QdmsMessageInterface(gameObject); LockPauseModule.CaptureMouse = true; SetDefaultPlayerView(); SetInitialViewModels(); ShieldComponent.Ref()?.HandleLoadStart(); TryExecuteOnComponents(component => component.Init(this)); Initialized = true; }