Ejemplo n.º 1
0
 // Instantiates an object of type Player.
 // This is the data model that represents the current state of a player
 // within the game world. It tracks the health and magic points of the
 // player and reports those as requested to the appropriate game objects.
 // Representation invariant: A player must always have 0 < health <= 100
 //                           A player must always have 0 <= magic <= 10
 void Start()
 {
     health = MAX_HEALTH;
     magic  = MAX_MAGIC;
     alive  = true;
     uiMgr  = GameObject.FindWithTag("GameUI").GetComponent <Game_UIManager>();
 }
Ejemplo n.º 2
0
 private void OnInitGameSceneGameFacade()
 {
     RequestManager = new Game_RequestManager();
     RequestManager.OnInit();//RequestManager 不能跟上面合并 不然会出现空指针
     PlayerManager = new Game_PlayerManager().OnInit();
     CameraManager = new Game_CameraManager().OnInit();
     UIManager     = new Game_UIManager();
     UIManager.OnInit();//UIManager 不能跟上面合并 不然会出现空指针
     AudioManager = new Game_AudioManager().OnInit();
 }
Ejemplo n.º 3
0
 void Start()
 {
     CustomMessages.Instance.MessageHandlers[CustomMessages.TestMessageID.AnchorRequest]  = this.ProcessAnchorRequest;
     CustomMessages.Instance.MessageHandlers[CustomMessages.TestMessageID.AnchorComplete] = this.ProcessAnchorComplete;
     CustomMessages.Instance.MessageHandlers[CustomMessages.TestMessageID.PlayerReady]    = this.SecondPlayerReadyCheck;
     SharingSessionTracker.Instance.SessionJoined += Instance_SessionJoined;
     pickup        = PickUpManager.Instance;
     healthDisplay = HealthDisplayBehavior.Instance;
     keyword       = KeywordManager.Instance;
     uiMgr         = GameObject.FindWithTag("GameUI").GetComponent <Game_UIManager>();
     gameEnded     = false;
 }