コード例 #1
0
	// Use this for initialization
	void Start () {

		UI_Stats = StatPanel.GetComponent<UI_StatsPanel>();

		health = Healthbar.GetComponent<UI_Bar>();
		power = PowerBar.GetComponent<UI_Bar>();
		ls = gameObject.GetComponent<Leveling_System>();
		//max_Blood = ls.currentLevel.Blood;
//		max_Love  = ls.currentLevel.Love;
		health.BarText = max_Blood.ToString();
		power.BarText = max_Love.ToString();
		Current_Blood = ls.currentLevel.Blood;
		Current_Love = ls.currentLevel.Love;
		

		UI_Stats.Blood_Text = ls.currentLevel.Blood.ToString();
		UI_Stats.Love_Text = ls.currentLevel.Love.ToString();
		UI_Stats.Dexterity_Text = ls.currentLevel.Dexterity.ToString();
		UI_Stats.Intelligence_Text = ls.currentLevel.Intelligence.ToString();
		UI_Stats.Luck_Text = ls.currentLevel.Luck.ToString();

	

	
	}
コード例 #2
0
    private void Start()
    {
        playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();

        health  = new UI_Bar(healthSlider, maxHealth, playerScript);
        breathe = new UI_Bar(breatheSlider, maxBreathe, playerScript);
        ammo    = new UI_Bar(ammoSlider, maxAmmo, playerScript);
        StartCoroutine(RegenUI(breathe));
        StartCoroutine(RegenUI(ammo));
    }
コード例 #3
0
ファイル: UI_BarEditor.cs プロジェクト: phiLyken/RC_1
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        m_UI_Bar = (target as UI_Bar);
        float old = m_progress;

        EditorGUILayout.MinMaxSlider(ref m_progress, ref m_progress, 0, 1);
        if (old != m_progress)
        {
            m_UI_Bar.SetProgress(m_progress);
        }
    }
コード例 #4
0
    private IEnumerator RegenUI(UI_Bar ui)
    {
        while (true)
        {
            if (ui.current < ui.max)
            {
                yield return(new WaitForSeconds(regenTimer));

                ui.Increase();
            }
            else
            {
                yield return(null);
            }
        }
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        UI_Stats = StatPanel.GetComponent <UI_StatsPanel>();

        health = Healthbar.GetComponent <UI_Bar>();
        power  = PowerBar.GetComponent <UI_Bar>();
        ls     = gameObject.GetComponent <Leveling_System>();
        //max_Blood = ls.currentLevel.Blood;
//		max_Love  = ls.currentLevel.Love;
        health.BarText = max_Blood.ToString();
        power.BarText  = max_Love.ToString();
        Current_Blood  = ls.currentLevel.Blood;
        Current_Love   = ls.currentLevel.Love;


        UI_Stats.Blood_Text        = ls.currentLevel.Blood.ToString();
        UI_Stats.Love_Text         = ls.currentLevel.Love.ToString();
        UI_Stats.Dexterity_Text    = ls.currentLevel.Dexterity.ToString();
        UI_Stats.Intelligence_Text = ls.currentLevel.Intelligence.ToString();
        UI_Stats.Luck_Text         = ls.currentLevel.Luck.ToString();
    }
コード例 #6
0
ファイル: Tank.cs プロジェクト: HJBell/TRL
    //-----------------------------Unity Functions-----------------------------

    private void Start()
    {
        mHealth         = MaxHealth;
        mTimeOfLastShot = Time.time - ReloadDuration;
        SetDestination(transform.position);

        foreach (var tintedObj in TintedObjects)
        {
            tintedObj.material.color = pColour;
        }

        if (Faction == Faction.Enemy)
        {
            gameObject.AddComponent <EnemyAI>();
        }

        mHealthBar = (Instantiate(HealthBarPrefab) as GameObject).GetComponent <UI_NodeBar>();
        mHealthBar.transform.SetParent(FindObjectOfType <Canvas>().transform);
        mHealthBar.transform.SetAsFirstSibling();
        mReloadBar = (Instantiate(ReloadBarPrefab) as GameObject).GetComponent <UI_Bar>();
        mReloadBar.transform.SetParent(FindObjectOfType <Canvas>().transform);
        mReloadBar.transform.SetAsFirstSibling();
    }
コード例 #7
0
 private void Start()
 {
     health  = new UI_Bar(healthSlider, maxHealth);
     breathe = new UI_Bar(breatheSlider, maxBreathe);
     ammo    = new UI_Bar(ammoSlider, maxAmmo);
 }