예제 #1
0
    public void createHPBar()
    {
        //HP Barの作成
        if (hpBar != null)
        {
            Destroy(hpBar.gameObject);
        }

        GameObject tmpHpbarGO = Instantiate(_HPBar) as GameObject;

        tmpHpbarGO.transform.parent = this.transform;

        tmpHpbarGO.transform.localPosition = Vector3.zero;
        //位置補正
        textureVector ttv  = new textureVector(this.gameObject);
        Vector3       tmpV = ttv.getBottomOffset_ForCenterPivot(0, -0.05f, animeScalingFlag);

        tmpHpbarGO.transform.localPosition += tmpV;

        hpBar = tmpHpbarGO.GetComponent <enemyHPBarScript>();
        hpBar.setMaxBarLength_argsWidth(ttv.getWidth(animeScalingFlag), thisEnemyStat.maxHP);
    }