示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        health = 100;
        power  = 100;
        //gameOver = false;



        GameObject gameControlObject = GameObject.FindWithTag("UI");

        if (gameControlObject != null)
        {
            //gameOverScript = gameControlObject.GetComponent<GameOverScript>();
            healthInstance = healthBarController.GetComponent <HealthBarController>();
            powerInstance  = powerBarController.GetComponent <PowerBarController>();

            healthInstance.setMaxHealth(100.0f);
            healthInstance.setHealth(100.0f);

            powerInstance.setMaxPower(100.0f);
            powerInstance.setPower(100.0f);
        }
        if (gameControlObject == null)
        {
            Debug.Log("Sorry ,Couldn't find object");
        }
    }
示例#2
0
 void Start()
 {
     scorescript = GetComponent <Scores>();
     // Assign the component
     PowerBar = GameObject.Find("ForceBar").GetComponent <PowerBarController>();
     Line     = GameObject.Find("Line").GetComponent <ArrowControl>();
     Line.gameObject.SetActive(false);
     // Assign the Rigidbody component to our private rb variable
     rb           = GetComponent <Rigidbody>();
     LastPosition = transform.position;
 }