Esempio n. 1
0
    IEnumerator RandomName(bool isMale)
    {
        yield return(null);

        UGUISpriteAnimation ani = transform.Find("nickname/Image_dice").GetComponent <UGUISpriteAnimation>();

        ani.PlayFromOldFrame();

        float diceTimer = DICE_TIME;
        float nameTimer = 0f;

        _isRandomingName = true;
        KeyEventManager.instance.EnableKeyboardEvent(false);
        while (diceTimer > 0)
        {
            diceTimer -= Time.deltaTime;
            nameTimer += Time.deltaTime;

            if (nameTimer >= 1f / CHANGE_NAME_FPS)
            {
                nameTimer = 0;
                SetRandomName(_xingArr, isMale);
            }

            yield return(null);
        }
        ani.Stop();
        _isRandomingName = false;
        KeyEventManager.instance.EnableKeyboardEvent(true);
    }
Esempio n. 2
0
    void Start()
    {
        panelUI = GameObject.Find("PanelUI").transform;

        questionManager       = GameObject.Find("questionManager").GetComponent <QuestionManager>();
        player                = GameObject.Find("Player");
        playerSpriteAnimation = player.GetComponent <UGUISpriteAnimation>();
        StartCoroutine(createAnswer(MyLevel));
    }
 static public int get_FPS(IntPtr l)
 {
     try {
         UGUISpriteAnimation self = (UGUISpriteAnimation)checkSelf(l);
         pushValue(l, self.FPS);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int Rewind(IntPtr l)
 {
     try {
         UGUISpriteAnimation self = (UGUISpriteAnimation)checkSelf(l);
         self.Rewind();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_FPS(IntPtr l)
 {
     try {
         UGUISpriteAnimation self = (UGUISpriteAnimation)checkSelf(l);
         System.Single       v;
         checkType(l, 2, out v);
         self.FPS = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_Loop(IntPtr l)
 {
     try {
         UGUISpriteAnimation self = (UGUISpriteAnimation)checkSelf(l);
         System.Boolean      v;
         checkType(l, 2, out v);
         self.Loop = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_SpriteFrames(IntPtr l)
 {
     try {
         UGUISpriteAnimation self = (UGUISpriteAnimation)checkSelf(l);
         System.Collections.Generic.List <UnityEngine.Sprite> v;
         checkType(l, 2, out v);
         self.SpriteFrames = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 8
0
    public override void OnInspectorGUI()
    {
        obj = target as UGUISpriteAnimation;
        base.OnInspectorGUI();
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("重播"))
        {
            obj.Rewind();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("恢复"))
        {
            obj.Resume();
        }
        if (GUILayout.Button("暂停"))
        {
            obj.Pause();
        }
        EditorGUILayout.EndHorizontal();
    }
Esempio n. 9
0
 public void InitAnimation(string animname)
 {
     this.animationConfig             = this.transform.Find("HandCardAnim").GetComponent <UGUISpriteAnimation>();
     this.animationConfig.m_SpiteName = animname;
     this.animationConfig.InitFrame(animname);
 }
Esempio n. 10
0
 public void InitAnimation(string animname)
 {
     this.animationConfig             = this.gameObject.GetComponent <UGUISpriteAnimation>();
     this.animationConfig.m_SpiteName = animname;
     this.animationConfig.InitFrame(animname);
 }