StatusBar.ShowBar C# (CSharp) Method

ShowBar() public method

public ShowBar ( int index, Vector2 pos ) : void
index int
pos Vector2
return void
    public void ShowBar(int index, Vector2 pos)
    {
        if(index < this.currentCharacter.Length && this.currentCharacter[index] != null)
        {
            float v1 = 0;
            float v2 = 0;
            if(this.statusID < 0)
            {
                v1 = this.currentCharacter[index].timeBar;
                v2 = DataHolder.BattleSystem().actionBorder;
            }
            else if(this.currentCharacter[index].status[this.statusID].IsConsumable())
            {
                v1 = this.currentCharacter[index].status[this.statusID].GetValue();
                v2 = this.currentCharacter[index].status[this.currentCharacter[index].status[this.statusID].maxStatus].GetValue();
            }
            else if(this.currentCharacter[index].status[this.statusID].IsNormal())
            {
                v1 = this.currentCharacter[index].status[this.statusID].GetValue();
                v2 = this.currentCharacter[index].status[this.statusID].maxValue;
            }
            else if(this.currentCharacter[index].status[this.statusID].IsExperience())
            {
                int current = this.currentCharacter[index].GetValueAtLevel(this.statusID, this.currentCharacter[index].currentLevel);
                v1 = this.currentCharacter[index].status[this.statusID].GetValue()-current;
                v2 = this.currentCharacter[index].GetValueAtLevel(this.statusID, this.currentCharacter[index].currentLevel+1)-current;
            }
            v2 /= 100;
            v1 /= v2;
            if(this.showEmpty)
            {
                GUI.DrawTexture(new Rect(this.bounds.x+pos.x, this.bounds.y+pos.y, this.bounds.width, this.bounds.height),
                        this.GetEmptyImage(), this.scaleMode, this.alphaBlend, this.imageAspect);
            }
            GUI.DrawTexture(new Rect(this.bounds.x+pos.x, this.bounds.y+pos.y, this.bounds.width*v1/100, this.bounds.height),
                    this.GetImage(), this.scaleMode, this.alphaBlend, this.imageAspect);
        }
    }