Esempio n. 1
0
    IEnumerator BanditBleed2()
    {
        Instantiate(Resources.Load <GameObject>("Prefabs/Dialogue/Count_Slash"), NPC2.transform);
        yield return(new WaitForSeconds(.5f));

        Instantiate(Resources.Load <GameObject>("Prefabs/Dialogue/Blood"), NPC2.transform);
        yield return(new WaitForSeconds(1f));

        NPC2.GetComponent <Animator>().Play("M3_NPC_Down_Dead");
    }
Esempio n. 2
0
    IEnumerator MoveBandits()
    {
        NPC.GetComponent <Rigidbody2D>().velocity = new Vector2(-.25f, 0);
        NPC.GetComponent <Animator>().Play("M_NPC_Left_Walk");

        NPC2.GetComponent <Rigidbody2D>().velocity = new Vector2(-.25f, 0);
        NPC2.GetComponent <Animator>().Play("M3_NPC_Left_Walk");

        yield return(new WaitForSeconds(3f));

        NPC.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        NPC.GetComponent <Animator>().Play("M_NPC_Left_Idle");

        NPC2.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        NPC2.GetComponent <Animator>().Play("M3_NPC_Left_Idle");
        yield return(new WaitForEndOfFrame());
    }
Esempio n. 3
0
        static void Main(string[] args)
        {
            NPC1 npc1 = new NPC1();
            NPC2 npc2 = new NPC2();

            npc1.Heal   += Show_Message;
            npc1.Attack += Show_Message;
            npc2.Heal   += Show_Message;
            npc2.Attack += Show_Message;

            npc1.MinusHealth(20);
            npc1.MinusHealth(60);
            npc1.PlusHealth(400);
            npc1.MinusHealth(200);
            npc1.MinusHealth(20);
            npc1.PlusHealth(40);
            npc1.Stat();
            WriteLine();

            npc2.MinusHealth(90);
            npc2.PlusHealth(20);
            npc2.MinusHealth(50);
            npc2.PlusHealth(80);
            npc2.PlusHealth(20);
            npc2.PlusHealth(50);
            npc2.MinusHealth(30);
            npc2.Stat();
            WriteLine();

            Func <string> editor;

            new StringEdit("И наиболее используемыми, с которыми часто приходится сталкиваться, являются Action, Predicate и Func.");
            editor  = StringEdit.DeletingPunctuationMarks;
            editor += StringEdit.ToLowerCase;
            editor += StringEdit.NumberAdding;
            editor += StringEdit.SpaceDeleting;
            editor += StringEdit.ToUpperCase;
            Operation(editor);
            WriteLine($"Окнончательный результат: {StringEdit.str}");
        }
    void Update()
    {
        if (PlayerManager.talk_man == 4)
        {
            if ((Input.GetKeyDown(KeyCode.Tab) &&  index == textList.Count) || (PlayerManager.isTalking && Input.GetKeyDown(KeyCode.Escape)))
            {
                index                = 0;
                playertalk           = 0;
                text_labe.text       = " ";
                NPC["村民3動畫UI"].time  = NPC["村民3動畫UI"].length;
                NPC["村民3動畫UI"].speed = -1;
                NPC.Play("村民3動畫UI");
                NPC2["村民2動畫UI"].time  = NPC2["村民2動畫UI"].length;
                NPC2["村民2動畫UI"].speed = -1;
                NPC2.Play("村民2動畫UI");
                player["主角UI"].time  = player["主角UI"].length;
                player["主角UI"].speed = -1;
                player.Play("主角UI");
                dailog["對話框"].time  = dailog["對話框"].length;
                dailog["對話框"].speed = -1;
                dailog.Play("對話框");
            }
            else if (Input.GetKeyDown(KeyCode.Tab) && textfinish && PlayerManager.talkable)
            {
                playertalk++;
                StartCoroutine(SetTextUI());
            }

            if (playertalk == 2 || playertalk == 4 || playertalk == 6 || playertalk == 7 || playertalk == 9)
            {
                m_NPC.color    = new Color(0.3f, 0.3f, 0.3f, 1);
                m_player.color = new Color(1, 1, 1, 1);
            }
            else
            {
                m_player.color = new Color(0.3f, 0.3f, 0.3f, 1);
                m_NPC.color    = new Color(1, 1, 1, 1);
            }
        }
    }