// Start is called before the first frame update
 void Start()
 {
     forwardRotationAngle = 1.0f;
     ethenAnimator        = GetComponent <Animator>();
     SelectedDanceMove    = DanceMoves.None;
     IsFighting           = false;
 }
Exemplo n.º 2
0
    void battle()
    {
        takePositionTime -= Time.deltaTime;
        if (takePositionTime <= 0)
        {
            if (currentDancer.danced == false)
            {
                currentDancer.anim.SetTrigger(currentDancer.danceName);
                currentDancer.danced = true;
            }
            else
            {
                waitingTime -= Time.deltaTime;
                if (waitingTime <= 0)
                {
                    waitingTime = 3;
                    stepCount++;
                    currentDancer.icon.sprite = blank;
                    if (stepCount > 3)
                    {
                        Stop      = true;
                        stepCount = 0;
                        GoToTheNextDancer();
                        return;
                    }
                    //元のステップといつも違うように
                    bool       isDifferent = false;
                    DanceMoves m           = DanceMoves.ballerin;
                    int        rnd         = 0;
                    while (!isDifferent)
                    {
                        //chose in enum class
                        rnd = UnityEngine.Random.Range(0, 3);
                        //convert int in enum
                        m = (DanceMoves)rnd;
                        if (m != lastMoves)
                        {
                            isDifferent = true;
                            lastMoves   = m;
                        }
                    }

                    //add to moves list
                    currentDancer.phaseMoves.Add(m);
                    //change icon
                    currentDancer.icon.sprite = icons[rnd];
                    danceMessage(stepCount);
                }
            }
        }
    }
Exemplo n.º 3
0
    //正しければポイントを貰う
    public void SendDanceMovement(DanceMoves mov)
    {
        string m = "";

        choseIndex++;
        switch (choseIndex)
        {
        case 0: m = "正解"; break;

        case 1: m = "もう一回"; break;

        case 2: m = "いい感じ"; break;
        }
        if (choseIndex > currentDancer.phaseMoves.Count)
        {
            return;
        }
        if (currentDancer.phaseMoves[choseIndex] == mov)
        {
            StartCoroutine(writeMessage(m));
            if (choseIndex == 2)
            {
                foreach (var s in stepSelectors)
                {
                    s.gameObject.SetActive(false);
                }
                player.GetComponent <Animator>().SetTrigger(currentDancer.danceName);
                EffectDirector.instance.generatePopUp(300);
                Invoke("goBack", 10);
            }
        }
        else
        {
            //そうではない場合は、出る
            StartCoroutine(writeMessage("間違いました、残念です"));
            foreach (var s in stepSelectors)
            {
                s.gameObject.SetActive(false);
            }
            goBack();
        }
    }
 void battle()
 {
     takePositionTime -= Time.deltaTime;
     if (takePositionTime <= 0)
     {
         if (currentDancer.danced == false)
         {
             currentDancer.anim.SetTrigger(currentDancer.danceName);
             currentDancer.danced = true;
         }
         else
         {
             waitingTime -= Time.deltaTime;
             if (waitingTime <= 0)
             {
                 waitingTime = 3;
                 stepCount++;
                 currentDancer.icon.sprite = blank;
                 if (stepCount > 3)
                 {
                     Stop      = true;
                     stepCount = 0;
                     GoToTheNextDancer();
                     return;
                 }
                 //chose in enum class
                 int rnd = UnityEngine.Random.Range(0, 3);
                 //convert int in enum
                 DanceMoves m = (DanceMoves)rnd;
                 //add to moves list
                 currentDancer.phaseMoves.Add(m);
                 //change icon
                 currentDancer.icon.sprite = icons[rnd];
                 danceMessage(stepCount);
             }
         }
     }
 }
 public void SetDanceMove(int danceMove)
 {
     SelectedDanceMove = (DanceMoves)danceMove;
 }