コード例 #1
0
ファイル: SCR_characterHealth.cs プロジェクト: balatimuz/cos
    public void StartUp(int id)
    {
        health    = healthMax;
        character = GetComponent <SCR_character>();

        bool deathSoundRandomPitch = true;

        if (character.isPlayer)
        {
            deathSoundRandomPitch = false;
        }
        //death sound
        SND_death = SCR_main.SetupSoundArray(transform, deathSound, deathSoundRandomPitch, true);

        GameObject healthBarInst = Instantiate(SCR_main.healthBarObj, Vector3.zero, Quaternion.identity) as GameObject;

        healthBar = healthBarInst.GetComponent <SCR_healthBar>();
        healthBar.StartUp(id);

        UpdateHealthBar();
    }
コード例 #2
0
ファイル: SCR_characterHealth.cs プロジェクト: balatimuz/cos
    public void StartUp(int id)
    {
        health=healthMax;
        character=GetComponent<SCR_character>();

        bool deathSoundRandomPitch=true;
        if(character.isPlayer){
            deathSoundRandomPitch=false;
        }
        //death sound
        SND_death=SCR_main.SetupSoundArray(transform,deathSound,deathSoundRandomPitch,true);

        GameObject healthBarInst=Instantiate(SCR_main.healthBarObj,Vector3.zero,Quaternion.identity) as GameObject;
        healthBar=healthBarInst.GetComponent<SCR_healthBar>();
        healthBar.StartUp(id);

        UpdateHealthBar();
    }