示例#1
0
 /// Use this for initialization
 ///overrides virtual Start() in EntityController
 protected override void Start()
 {
     base.Start();
     ProceduralComponentConnector.AllocateGUICameraListener(this);
     ProceduralComponentConnector.AllocatePlayerGUILink(this);
     if (inputTime <= 0)
     {
         Debug.LogError("Player Controller Input Time initialized to bad value " + inputTime + ", now setting to 2");
         inputTime = 2;
     }
     if (puppetEntity != null)
     {
         maxRemainingTime = Player_Turn_WaitTime_Base + ((puppetEntity.speed - 1) * Player_Turn_WaitTime_Speed_Increment);
         remainingTime    = maxRemainingTime;
         bool needToPrepProcedural = false; //if we don't have a health,energy,time slider, notify component connector
         if (playerHealthSlider != null)
         {
             playerHealthSlider.value    = puppetEntity.SetUIHealthChangeListener(UpdateDisplayHealth);
             playerHealthSlider.maxValue = puppetEntity.maxHealth;
         }
         else
         {
             Debug.LogError("Alert! Player Health Slider not configured!");
         }
         if (playerEnergySlider != null)
         {
             playerEnergySlider.value    = energy;
             playerEnergySlider.maxValue = maxEnergy;
         }
         else
         {
             Debug.LogError("Alert! Player Energy Slider not configured!");
         }
         if (playerTimeSlider != null)
         {
             playerTimeSlider.value    = remainingTime;
             playerTimeSlider.maxValue = maxRemainingTime;
         }
         else
         {
             Debug.LogError("Alert! Player Time Slider not configured!");
         }
     }
     else
     {
         Debug.LogError("Alert! TestPlayerController is missing a puppetEntity to control!");
     }
     if (Board.theMatchingBoard != null)
     {
         Board.theMatchingBoard.SetScoreIncreaseListener(this.ReceiveMatchPoints);
     }
     else
     {
         Debug.LogError("Alert! " + this + " was unable to sync with static Board instance to configure Score change listening!");
     }
 }
    // Use this for initialization
    void Start()
    {
        Canvas testCanvas = this.GetComponent <Canvas>();

        if (testCanvas == null)
        {
            Debug.LogError("GUI Player Connector unable to get Canvas for GUI connection");
            return;
        }
        ProceduralComponentConnector.AllocateGUICameraListener(testCanvas);
    }
示例#3
0
 /// <summary>
 /// Tries to make first EntityController start its turn
 /// if turnOrder is empty, print error to console
 /// </summary>
 public void StartTurn()
 {
     ProceduralComponentConnector.DeAllocate();
     Debug.Log("Starting Turn");
     if (turnOrder.Count > 0)
     {
         //Debug.Log("Turn order starts with " + turnOrder.First.Value);
         turnOrder.First.Value.StartTurn();             //after entity starts its turn, it will eventually tell Dungeon Manager to end turn
         gameStarted = true;
     }
     else
     {
         Debug.LogError("Turn Order is empty, can't start turns");
     }
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        if (healthSlider == null)
        {
            Debug.LogError("Health slider not initialized in GUI Holder");
            return;
        }

        if (energySlider == null)
        {
            Debug.LogError("Energy slider not initialized in GUI Holder");
            return;
        }

        if (timeSlider == null)
        {
            Debug.LogError("Time slider not initialized in GUI Holder");
            return;
        }
        ProceduralComponentConnector.AllocatePlayerGUILink(healthSlider, timeSlider, energySlider);
    }