コード例 #1
0
    private void SpeakCharacterName(int idx, int playerSelecting)
    {
        int narratorIndex = 24 + idx;

        PD.sounds.SetVoiceAndPlay(SoundPaths.NarratorPath + narratorIndex.ToString("d3"), 0);
        int val = Random.Range(1, 4);

        PD.sounds.QueueVoice(SoundPaths.VoicePath + PD.GetPlayerSpritePathFromInt(idx) + "/" + val.ToString("d3"));
    }
コード例 #2
0
    private void UpdateBackground(bool first)
    {
        string path = "";

        if (first)
        {
            path = PD.GetPlayerSpritePathFromInt(cursor.getX(), true);
        }
        else
        {
            if (cursor2 == null)
            {
                path = "Default";
            }
            else
            {
                path = PD.GetPlayerSpritePathFromInt(cursor2.getX(), true);
            }
        }
        Sprite old = Resources.Load <Sprite> (SpritePaths.BGPath + path);
        Rect   r   = originalRect;
        float  dx  = 0.0f;

        if (!first)
        {
            dx += r.width * 0.5f;
        }
        Sprite cropped = Sprite.Create(old.texture, new Rect(r.x + dx, r.y, r.width * 0.5f, r.height), new Vector2(0.5f, 0.5f), 144.0f);

        if (first)
        {
            bg1.GetComponent <SpriteRenderer>().sprite = cropped;
        }
        else
        {
            bg2.GetComponent <SpriteRenderer>().sprite = cropped;
        }
    }