Пример #1
0
 // Use this for initialization
 void Awake()
 {
     m_tweens = new List<ITween>();
     m_timer = 0.0f;
     m_instance = this;
     m_instance.gameObject.SetActive(false);
 }
    public void OnClickSkillItem()
    {
        if (previousSelectedButton != null)
        {
            Destroy(GameObject.Find("SkillNav"));
        }
        currentSelectedButton  = EventSystem.current.currentSelectedGameObject;
        previousSelectedButton = previousSelectedButton == null ? EventSystem.current.currentSelectedGameObject:
                                 currentSelectedButton;
        GameObject answerPrefab = Instantiate(Resources.Load("Prefabs/SkillNav")) as GameObject;

        answerPrefab.transform.SetParent(EventSystem.current.currentSelectedGameObject.transform, false);
        TweenController.TweenScaleToSmall(previousSelectedButton.transform,
                                          new Vector3(1.0f, 1.0f, 1.0f), 0.5f);
        TweenController.TweenScaleToLarge(EventSystem.current.currentSelectedGameObject.transform,
                                          new Vector3(1.10f, 1.10f, 1.10f), 0.5f);
        answerPrefab.name = "SkillNav";
        answerPrefab.transform.localPosition = new Vector3(53,
                                                           EventSystem.current.currentSelectedGameObject.transform.localPosition.y, 0);
        answerPrefab.transform.SetAsFirstSibling();
        answerPrefab.transform.GetChild(1).GetComponent <Button> ().onClick.AddListener(() => {
            OnClickInfo();
        });
        answerPrefab.transform.GetChild(2).GetComponent <Button> ().onClick.AddListener(() => {
            OnClickUse();
        });
        //TweenController.TweenMoveTo (answerPrefab.transform,),0.5f);
        //_scrollRect.content.GetChild(0).transform.SetAsLastSibling();
    }
    public void OnClickInfo()
    {
        skillOverViewScreen.SetActive(true);
        TweenController.TweenScaleToLarge(skillOverViewScreen.transform, new Vector3(1, 1, 1), 0.2f);
        skillSprite.GetComponentInChildren <Image>().sprite = currentSelectedButton.transform.GetChild(2).GetComponentInChildren <Image> ().sprite;
        switch (currentSelectedButton.name)
        {
        case "BicPunch":
            skillOverViewDesc.GetComponentInChildren <Text> ().text = SkillManager.Instance.skillList[0].skillDescription;
            skillDamage.GetComponentInChildren <Text> ().text       = "9";
            skillHeal.GetComponentInChildren <Text> ().text         = "0";
            skillGp.GetComponentInChildren <Text> ().text           = "3";
            skillName.GetComponentInChildren <Text> ().text         = SkillManager.Instance.skillList[0].skillName.ToString();
            break;

        case "Sunder":
            skillOverViewDesc.GetComponentInChildren <Text> ().text = SkillManager.Instance.skillList[1].skillDescription;
            skillDamage.GetComponentInChildren <Text> ().text       = "10";
            skillHeal.GetComponentInChildren <Text> ().text         = "5";
            skillGp.GetComponentInChildren <Text> ().text           = "9";
            skillName.GetComponentInChildren <Text> ().text         = SkillManager.Instance.skillList[1].skillName.ToString();
            break;

        case "Rejuvenation":
            skillOverViewDesc.GetComponentInChildren <Text> ().text = SkillManager.Instance.skillList[2].skillDescription;
            skillDamage.GetComponentInChildren <Text> ().text       = "0";
            skillHeal.GetComponentInChildren <Text> ().text         = "8";
            skillGp.GetComponentInChildren <Text> ().text           = "4";
            skillName.GetComponentInChildren <Text> ().text         = SkillManager.Instance.skillList[2].skillName.ToString();
            break;
        }
        Destroy(EventSystem.current.currentSelectedGameObject.transform.parent.gameObject);
    }
Пример #4
0
 public void SearchRoom()
 {
     AudioController.Instance.PlayAudio(AudioEnum.ClickButton);
     //matchSword.GetComponentInChildren<Animation> ().Play ("FindMatchAnimation");
     matchSword.GetComponentInChildren <Animation> ().PlayQueued("FindMatchAnimation", QueueMode.PlayNow);
     matchSword.GetComponentInChildren <Animation> ().PlayQueued("MatchingLoop", QueueMode.CompleteOthers).wrapMode = WrapMode.Loop;
     matchingText.text = "Matching...";
     TweenController.TweenMoveTo(matchingText.transform, new Vector2(matchingText.transform.localPosition.x, matchingText.transform.localPosition.y + 160f), 0.5f);
     TweenController.TweenMoveTo(menu.transform, new Vector2(menu.transform.localPosition.x, menu.transform.localPosition.y - 160f), 0.5f);
     ScreenController.Instance.StartMatchingScreen();
     searchRoomButton.interactable = false;
     FDController.Instance.SearchRoom(delegate(bool result) {
         if (result)
         {
             GoToGameRoom();
         }
         else
         {
             Debug.Log("Cancelled Search");
             searchRoomButton.interactable = true;
             matchSword.GetComponentInChildren <Animation> ().Play("MatchIdle");
             AudioController.Instance.PlayAudio(AudioEnum.ClickButton);
             matchingText.text = "Find Match";
             TweenController.TweenMoveTo(matchingText.transform, new Vector2(matchingText.transform.localPosition.x, matchingText.transform.localPosition.y - 160f), 0.5f);
             TweenController.TweenMoveTo(menu.transform, new Vector2(menu.transform.localPosition.x, menu.transform.localPosition.y + 160f), 0.5f);
         }
         ScreenController.Instance.StopMatchingScreen();
     });
 }
Пример #5
0
 public void LerpToMatch(Button match)
 {
     TweenController.TweenMoveTo(viewGroup.transform, -matchView.transform.localPosition, 0.5f);
     TweenController.TweenMoveTo(menuIndicator.transform, matchButton.transform.localPosition, 0.3f);
     colorToDefault();
     match.gameObject.GetComponentInChildren <Image> ().color = new Color32(66, 135, 199, 255);
     TweenController.TweenScaleToLarge(match.transform.GetChild(0).transform, new Vector3(1.3f, 1.3f, 1.3f), 0.2f);
 }
Пример #6
0
 public void LerpBackToHome(Button home)
 {
     TweenController.TweenMoveTo(viewGroup.transform, new Vector2(0, 0), 0.5f);
     TweenController.TweenMoveTo(menuIndicator.transform, homeButton.transform.localPosition, 0.3f);
     colorToDefault();
     home.gameObject.GetComponentInChildren <Image> ().color = new Color32(66, 135, 199, 255);
     TweenController.TweenScaleToLarge(home.transform.GetChild(0).transform, new Vector3(1.3f, 1.3f, 1.3f), 0.2f);
 }
Пример #7
0
 public void colorToDefault()
 {
     skillButton.gameObject.GetComponentInChildren <Image> ().color = new Color32(20, 65, 96, 255);
     matchButton.gameObject.GetComponentInChildren <Image> ().color = new Color32(20, 65, 96, 255);
     homeButton.gameObject.GetComponentInChildren <Image> ().color  = new Color32(20, 65, 96, 255);
     TweenController.TweenTextScale(skillButton.transform.GetChild(0).transform, Vector3.one, 0.2f);
     TweenController.TweenTextScale(matchButton.transform.GetChild(0).transform, Vector3.one, 0.2f);
     TweenController.TweenTextScale(homeButton.transform.GetChild(0).transform, Vector3.one, 0.2f);
 }
Пример #8
0
    private void CombinateScale()
    {
        Vector3 startScale = transform.localScale;
        Vector3 endScale   = Vector3.one * 2;

        TweenController.Tween(gameObject, "CombinateScale", false, 0, 1, timeToCombinate, (tween) => {
            Vector3 scale        = Vector3.Lerp(startScale, endScale, animationCurve.Evaluate(tween.progress));
            transform.localScale = scale;
        });
    }
Пример #9
0
 public void OnNotify(bool isConnectedDB)
 {
     if (!isConnectedDB)
     {
         connectionIndicator.enabled = true;
         TweenController.TweenImageFadeInFadeOut(connectionIndicator);
     }
     else
     {
         connectionIndicator.enabled = false;
     }
 }
    public void ShowGestureButtons(Transform button)
    {
        if (!gestureButtonContainer.activeInHierarchy)
        {
            gestureButtonContainer.SetActive(true);
            TweenController.TweenScaleToLarge(gestureButtonContainer.transform, new Vector3(1, 1, 1), 0.4f);

            button.gameObject.GetComponent <Image> ().sprite = closeImage;
        }
        else
        {
//			TweenController.TweenScaleToLarge (gestureButtonContainer.transform, new Vector3(1,1,1), 0.2f);
            button.gameObject.GetComponent <Image> ().sprite = gestureImage;
            Invoke("ScaleToSmall", 0.05f);
        }
    }
 public void SelectSkill(int skillNumber)
 {
     if (activateAutoSkill)
     {
         skillButtonToggleOn [skillNumber - 1] = !skillButtonToggleOn [skillNumber - 1];
         ActivateSkillIndicator(skillNumber);
     }
     else
     {
         if (skillButton [skillNumber - 1].interactable)
         {
             TweenController.TweenScaleToLarge(EventSystem.current.currentSelectedGameObject.transform, Vector3.one, 0.3f);
             SelectSkillReduce(skillNumber);
         }
     }
 }
Пример #12
0
 private void MoveToWeaponTween()
 {
     if (collisionsCounter <= 1)
     {
         Vector3 startPos   = transform.position;
         Vector3 endPos     = WeaponController.Instance.jointWeapon.position;
         Vector3 startScale = transform.localScale = new Vector3(1, 1, 1);
         Vector3 endScale   = transform.localScale = Vector3.zero;
         TweenController.Tween(gameObject, "enemy", false, 0, 1, timeToPull, (tween) => {
             Vector3 pos          = Vector3.Lerp(startPos, endPos, tween.progress);
             Vector3 scale        = Vector3.Lerp(startScale, endScale, tween.progress);
             transform.position   = pos;
             transform.localScale = scale;
         }, (tween) => {
             WeaponController.Instance.ChargedBulletUI(thisObj);
         });
     }
 }
    public void DeployEffect(bool result, List <GameObject> answerButtons, string answer, GameObject questionType)
    {
        answerResult          = result;
        questionAnswer        = answer;
        questionTypeComponent = questionType;
        ShowAnswer(answerButtons);

        if (result)
        {
            //	GpGotEffect (gpText);
            CorrectAnswerEffect(questionAnswer, answerButtons, questionType);
            AudioEffect(AudioEnum.Correct);
        }
        else
        {
            AudioEffect(AudioEnum.Mistake);
        }
        questionTypeComponent = questionType;
        TweenController.TweenShakePosition(questionTypeComponent.transform, 1.0f, 30.0f, 50, 90f);
    }
Пример #14
0
    public void OnSelectionClick(Button letterButton)
    {
        AudioController.Instance.PlayAudio(AudioEnum.ClickButton);

        if (string.IsNullOrEmpty(letterButton.transform.GetChild(0).GetComponent <Text> ().text))
        {
            TweenController.TweenShakePosition(letterButton.transform, 1.0f, 30.0f, 50, 90f);
        }
        else
        {
            answerIdentifier[answerIndex] = letterButton.gameObject;
            answerWrote = "";
            answerButtons [(answerIndex - 1)].GetComponentInChildren <Text>().text
                = letterButton.GetComponentInChildren <Text>().text;
            letterButton.GetComponentInChildren <Text>().text = selectionType == QuestionSystemEnums.SelectionType.Typing
                                ? letterButton.GetComponentInChildren <Text>().text: "";

            for (int j = 0; j < questionAnswer.Length; j++)
            {
                answerWrote += answerButtons [j].transform.GetChild(0).GetComponent <Text> ().text;
            }

            if (answerWrote.Length.Equals(questionAnswer.Length))
            {
                if (answerWrote.ToUpper().Equals(questionAnswer.ToUpper()))
                {
                    CheckAnswer(true);
                }
                else
                {
                    CheckAnswer(false);
                }
            }
            CheckAnswerHolder();
        }
    }
Пример #15
0
    protected void OnAnswerClick(Button answerButton)
    {
        AudioController.Instance.PlayAudio(AudioEnum.ClickButton);
        string answerclicked = "";

        if (string.IsNullOrEmpty(answerButton.transform.GetChild(0).GetComponent <Text> ().text))
        {
            TweenController.TweenShakePosition(answerButton.transform, 0.5f, 15.0f, 50, 90f);
        }
        else
        {
            Debug.Log(answerButton.name);
            for (int i = 1; i < 12 + 1; i++)
            {
                if (answerButton.name.Equals("output" + i))
                {
                    answerclicked = answerButtons [i - 1].transform.GetChild(0).GetComponent <Text> ().text;
                    answerButtons [i - 1].transform.GetChild(0).GetComponent <Text> ().text = "";
                    answerIdentifier [i].transform.GetChild(0).GetComponent <Text> ().text  = answerclicked;
                }
            }
            CheckAnswerHolder();
        }
    }
Пример #16
0
 public void StopWaitOpponentScreen()
 {
     TweenController.TweenStopWaitOpponent(0.2f, waitOpponentGroup);
 }
Пример #17
0
 public void LerpProfileView(Button start)
 {
     TweenController.TweenMoveTo(viewGroup.transform, profileView.transform.localPosition, 0.3f);
     menu.SetActive(true);
     lobbyView.SetActive(false);
 }
 public void OnCloseSkillOverView()
 {
     TweenController.TweenTextScale(skillOverViewScreen.transform, new Vector3(1, 1, 1), 0.5f);
     skillOverViewScreen.SetActive(false);
 }
 private void GpGotEffect(GameObject gpText)
 {
     gpText.GetComponent <Text> ().text = "1 GP";
     TweenController.TweenTextScale(gpText.transform, new Vector3(3, 3, 3), 1.0f);
 }
Пример #20
0
    public override void OnInspectorGUI()
    {
        TweenController tw = target as TweenController;

        //serializedObject.Update();
        EditorGUILayout.PropertyField(delayTime);
        EditorGUILayout.PropertyField(time);

        EditorGUI.indentLevel   = 0;
        tw.isUseAdditionalParam = EditorGUILayout.ToggleLeft("自定义物体", tw.isUseAdditionalParam);
        if (tw.isUseAdditionalParam)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.PropertyField(playOnStart);
            EditorGUILayout.PropertyField(animGameObj);
        }

        EditorGUI.indentLevel = 0;
        tw.moveType           = (TweenType)EditorGUILayout.EnumPopup("移动 (Move)", (System.Enum)tw.moveType);
        if (tw.moveType != TweenType.None)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.PropertyField(xCurve);
            EditorGUILayout.PropertyField(yCurve);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(fromPos);
            if (GUILayout.Button("reset"))
            {
                try
                {
                    tw.fromPos = tw.animGameObj.transform.GetComponent <RectTransform>().anchoredPosition;
                }
                catch
                {
                    throw new System.Exception("此按钮仅 自定义物体时 可用, 若需自定义请指定物体到 Anim Game Obj");
                }
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(toPos);
            if (GUILayout.Button("reset"))
            {
                try
                {
                    tw.toPos = tw.animGameObj.transform.GetComponent <RectTransform>().anchoredPosition;
                }
                catch
                {
                    throw new System.Exception("此按钮仅 自定义物体时 可用, 若需自定义请指定物体到 Anim Game Obj");
                }
            }
            EditorGUILayout.EndHorizontal();

            tw.offsetType = (TweenType)EditorGUILayout.EnumPopup("偏移 (offset)", (System.Enum)tw.offsetType);
            if (tw.offsetType != TweenType.None)
            {
                EditorGUILayout.PropertyField(offsetCurve);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PropertyField(offset);
                EditorGUILayout.EndHorizontal();
            }
        }

        EditorGUI.indentLevel = 0;
        tw.scaleType          = (TweenType)EditorGUILayout.EnumPopup("缩放 (Scale)", (System.Enum)tw.scaleType);
        if (tw.scaleType != TweenType.None)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.PropertyField(scaleCurve);
            EditorGUILayout.PropertyField(fromScale);
            EditorGUILayout.PropertyField(toScale);
        }
        EditorGUI.indentLevel = 0;
        tw.rotateType         = (TweenType)EditorGUILayout.EnumPopup("旋转 (Rotate)", (System.Enum)tw.rotateType);
        if (tw.rotateType != TweenType.None)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.PropertyField(rotateCurve);
            EditorGUILayout.PropertyField(fromRotate);
            EditorGUILayout.PropertyField(toRotate);
        }
        EditorGUI.indentLevel = 0;
        tw.alphaType          = (TweenType)EditorGUILayout.EnumPopup("透明 (Alpha)", (System.Enum)tw.alphaType);
        if (tw.alphaType != TweenType.None)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.PropertyField(alphaCurve);
            EditorGUILayout.PropertyField(fromAlpha);
            EditorGUILayout.PropertyField(toAlpha);
        }

        serializedObject.ApplyModifiedProperties();
    }
 public void ScaleToSmall()
 {
     TweenController.TweenScaleToSmall(gestureButtonContainer.transform, new Vector3(0.7f, 0.7f, 0.7f), 0.1f);
     Invoke("HideGestureButton", 0.05f);
 }
Пример #22
0
 public void StartWaitOpponentScreen()
 {
     TweenController.TweenStartWaitOpponent(0.2f, waitOpponentGroup, loadingIndicator);
 }
Пример #23
0
 private void Awake()
 {
     isAwake   = true;
     _Instance = this;
 }
Пример #24
0
    public TweenObjAttribute(TweenType moveType, TweenType scaleType, TweenType rotateType, TweenType alphaType, TweenController tweenController)
    {
        this.moveType   = moveType;
        this.scaleType  = scaleType;
        this.rotateType = rotateType;
        this.alphaType  = alphaType;

        fromPos = tweenController.fromPos;
        toPos   = tweenController.toPos;

        fromScale = tweenController.fromScale;
        toScale   = tweenController.toScale;

        fromRotate = tweenController.fromRotate;
        toRotate   = tweenController.toRotate;

        fromAlpha = tweenController.fromAlpha;
        toAlpha   = tweenController.toAlpha;
    }
Пример #25
0
 public void TweenCallBack()
 {
     TweenController.TweenTextScale(gpText.transform, Vector3.one, 1.0f);
     gpText.GetComponent <Text> ().text = " ";
 }