Example #1
0
    void SwipeSequence()
    {
        if (!mIsCompleted)
        {
            if (mSwipeController.mIsComplete)
            {
                mIsCompleted = true;
                mSwipeController.mIsComplete = false;
                if (!mSwipeController.mIsSwipedCorrectly)
                {
                    mAudioSource.GetComponent <AudioSource>().Play();
                    mIsDamaged = true;
                }
            }
            else
            {
                mSwipeController.EnableSwipeContoller();
            }
        }

        if (mTime > mTimeInput)
        {
            if (!mIsCompleted)
            {
                mAudioSource.GetComponent <AudioSource>().Play();
                Debug.Log("take damage");
                mIsDamaged = true;
                mSwipeController.ResetRectValue();
            }
            SetValueToDefault();
            mActionSequence = mNextActionSequence;
        }
    }
Example #2
0
    void ClickInSequence()     // Fend Off by clicking
    {
        mNoOfButton = 4;

        if (!mIsCompleted)
        {
            if (mClickController.mIsComplete)
            {
                mIsCompleted = true;
                SetButtonToDefault();
                if (!mClickController.mIsClickedCorrectly)
                {
                    mIsDamaged = true;
                    mAudioSource.Play();
                }
            }
            else if (mRedoActionTimes == 0)
            {
                mClickController.ClickType = ClickController.TypeOfClick.CLICK_IN_SEQUENCE;

                if (mClickController.SequenceButton <= 3)
                {
                    mClickController.Region4.x      = 0.65f;
                    mClickController.Region4.y      = 0.7f;
                    mClickController.Region4.width  = mValueOffSet;
                    mClickController.Region4.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 2)
                {
                    mClickController.Region3.x      = 0.25f;
                    mClickController.Region3.y      = 0.6f;
                    mClickController.Region3.width  = mValueOffSet;
                    mClickController.Region3.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 1)
                {
                    mClickController.Region2.x      = 0.6f;
                    mClickController.Region2.y      = 0.3f;
                    mClickController.Region2.width  = mValueOffSet;
                    mClickController.Region2.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 0)
                {
                    mClickController.Region1.x      = 0.2f;
                    mClickController.Region1.y      = 0.2f;
                    mClickController.Region1.width  = mValueOffSet;
                    mClickController.Region1.height = mValueOffSet;
                }
            }
            else if (mRedoActionTimes == 1)
            {
                if (mClickController.SequenceButton <= 3)
                {
                    mClickController.Region4.x      = 0.35f;
                    mClickController.Region4.y      = 0.15f;
                    mClickController.Region4.width  = mValueOffSet;
                    mClickController.Region4.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 2)
                {
                    mClickController.Region3.x      = 0.65f;
                    mClickController.Region3.y      = 0.75f;
                    mClickController.Region3.width  = mValueOffSet;
                    mClickController.Region3.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 1)
                {
                    mClickController.Region2.x      = 0.25f;
                    mClickController.Region2.y      = 0.65f;
                    mClickController.Region2.width  = mValueOffSet;
                    mClickController.Region2.height = mValueOffSet;
                }

                if (mClickController.SequenceButton <= 0)
                {
                    mClickController.ClickType      = ClickController.TypeOfClick.CLICK_IN_SEQUENCE;
                    mClickController.Region1.x      = 0.7f;
                    mClickController.Region1.y      = 0.2f;
                    mClickController.Region1.width  = mValueOffSet;
                    mClickController.Region1.height = mValueOffSet;
                }
            }
        }
        mTime += Time.deltaTime;
        if (mTime > mTimeInput)
        {
            if (!mIsCompleted)
            {
                mAudioSource.Play();
                Debug.Log("take damage");
                mIsDamaged = true;
                mSwipeController.ResetRectValue();
            }
            SetValueToDefault();
            SetButtonToDefault();

            if (mRedoActionTimes < 1)
            {
                mActionSequence   = ActionSequence.FEND_OFF_CLICK;
                mRedoActionTimes += 1;
                Debug.Log(mRedoActionTimes);
            }
            else if (mRedoActionTimes == 1)
            {
                mActionSequence  = ActionSequence.CRAWL;
                mRedoActionTimes = 0;
                GameObject.Find("YurikoPrefab(Clone)").transform.position = mTriggerScript.SpawnPosition.transform.position;
                AddAnimationSequence("MoveBackScript", 5.5f, false);
                //base.Update();
                //GameObject.Find ("YurikoPrefab(Clone)").GetComponent<MoveBackScript>().mMoveTimer = 0.5f;
                if (!mIsChangeAction)
                {
                    mIsChangeAction = true;
                }
            }
        }
    }