Ejemplo n.º 1
0
    public int GetPlayerLevel(out float progress)
    {
        var levelMap = ConfigDataStatic.GetConfigDataTable("PLAYER_LEVEL");
        int i        = 0;

        for (i = 1; i <= 20; i++)
        {
            PLAYER_LEVEL data = levelMap[i] as PLAYER_LEVEL;
            if (personContribution < data.PlayerCap)
            {
                if (i == 1)
                {
                    progress = (float)personContribution / (float)data.PlayerCap;
                }
                else
                {
                    PLAYER_LEVEL preData = levelMap[i - 1] as PLAYER_LEVEL;
                    progress = (float)(personContribution - preData.PlayerCap) / (float)(data.PlayerCap - preData.PlayerCap);
                }
                return(i);
            }
        }
        progress = 1.0f;
        return(20);
    }
        // Start is called before the first frame update
        void Start()
        {
            //Rigidbody2dコンポーネントを取得
            this.rigidbody = GetComponent <Rigidbody2D>();
            //
            sound = GetComponent <AudioSource>();
            //状態、大きさをセット
            GameMode    = GAMEMODE.STAY_START;
            GameSpeed   = 0;
            playerLevel = PLAYER_LEVEL.Lv1;

            //スプライトの幅を取得
            spriteWidth = GetComponent <SpriteRenderer>().bounds.size.x;
            //
            collider2d = GetComponent <CircleCollider2D>();
            //
            animator = GetComponent <Animator>();

            spriteRenderer = GetComponent <SpriteRenderer>();

            this.animator.SetInteger("Level", 1);
            this.animator.speed = 0;
            UnkoScore           = 0;
            timeScore           = 0;
        }
Ejemplo n.º 3
0
    public static int CalculatePlayerLevel(int contribution)
    {
        var levelMap = ConfigDataStatic.GetConfigDataTable("PLAYER_LEVEL");

        for (int i = 1; i <= 20; i++)
        {
            PLAYER_LEVEL data = levelMap[i] as PLAYER_LEVEL;
            if (contribution < data.PlayerCap)
            {
                return(i);
            }
        }
        return(20);
    }
Ejemplo n.º 4
0
    public int GetPlayerLevel()
    {
        var levelMap = ConfigDataStatic.GetConfigDataTable("PLAYER_LEVEL");
        int i        = 0;

        for (i = 1; i <= 20; i++)
        {
            PLAYER_LEVEL data = levelMap[i] as PLAYER_LEVEL;
            if (personContribution < data.PlayerCap)
            {
                return(i);
            }
        }
        return(20);
    }
 private void ChangeLv5()
 {
     this.animator.SetInteger("Level", 5);
     collider2d.radius = 0.5f;
     playerLevel       = PLAYER_LEVEL.Lv5;
 }