Esempio n. 1
0
    public void Load_Lv_Data(G0_Lv_Data data)
    {
        //決定這場要哪些地點
        int [] rD = new int [Now_Lv_Data.All_Target.Length];        //每個地點抽到的機率
        for (int i = 0; i < rD.Length; i++)
        {
            rD [i] = 1;
        }
        Now_Traget_Nobs = Dice <int> .GetNotRepeatingInts(Now_Lv_Data.N, rD);

        UI.Map.sprite = data.Map_Im;

        All_Photo = new List <G0_Photo_UICon> ();
        G0_Photo_UICon.AllPhoto = null;
        for (int i = 0; i < Now_Traget_Nobs.Length; i++)
        {
            int            Nob = Now_Traget_Nobs [i];
            G0_Photo_UICon r   = MyCalculate.SpObj(UI.Photo_Obj, UI.Photo_Parent.transform, Vector3.zero).GetComponent <G0_Photo_UICon> ();
            r.Load_Target_Data(data.All_Target [Nob]);
            All_Photo.Add(r);
        }

        All_Target = new List <G0_Target_UICOn> ();
        G0_Target_UICOn.AllTarget = null;
        for (int i = 0; i < data.All_Target.Length; i++)
        {
            G0_Target_Data  Target = data.All_Target [i];
            G0_Target_UICOn r      = MyCalculate.SpObj(UI.Traget_Obj, UI.Target_Parent.transform, (Vector2)Target.Pot).GetComponent <G0_Target_UICOn> ();
            r.Data = Target;
            All_Target.Add(r);
        }
    }
Esempio n. 2
0
    public void  Open(int Nob)
    {
        string _Nob = Nob.ToString();

        int [] NobInt = new int [_Nob.Length];
        for (int i = 0; i < NobInt.Length; i++)
        {
            NobInt [i] = "0123456789".IndexOf(_Nob [i]);
            ObjArray OA = MyCalculate.SpObj(NobObj.gameObject, m_Nob.transform, Vector3.zero).GetComponent <ObjArray> ();
            OA.OnOnlyObjs(NobInt [i]);
            OA.gameObject.SetActive(true);
        }

        m_Nob.GetComponent <Tween_Color> ().Del += (f) => {
            Image [] Ims = GetComponentsInChildren <Image> ();
            foreach (Image i in Ims)
            {
                i.color = m_Nob.GetComponent <Tween_Color> ().NowColor;
            }
        };
        m_Nob.GetComponent <Tween_Color> ().End_Del += () => {
            Destroy(gameObject);
        };
        m_Nob.SetActive(true);
        m_Nob.GetComponent <Tween_Color> ().Play(true);
    }
Esempio n. 3
0
    public GameObject SpOneNumber(string Name)       //生產數字
    {
        GameObject a = MyCalculate.SpObj(Number, transform, Vector3.zero);

        ChIm(a.GetComponent <UISprite> (), Name);
        return(a);
    }
Esempio n. 4
0
 public void Open(int MaxHP)
 {
     for (int i = 1; i < MaxHP; i++)
     {
         MyCalculate.SpObj(HPObj, transform, Vector3.zero, i.ToString());
     }
     SetObj();
     HP = MaxHP;
 }
Esempio n. 5
0
    public void Sp_Obj(bool LR, bool IsOK)
    {
        Vector3 StartPot = AllObj [LR ? 1 : 0].obj.transform.localPosition;
        int     Y        = IsOK ? Random.Range(8, 10) : Random.Range(3, 7);

        Vector3 Obj_v = new Vector2(Random.Range(1, 11), Y);

        Obj_v.x *= LR ? -1 : 1;

        MyCalculate.SpObj(G1_Obj [Random.Range(0, G1_Obj.Length)].gameObject, transform, StartPot).GetComponent <G1_Obj> ().Open(Obj_v);
    }
Esempio n. 6
0
    void Start()
    {
        UI.d.Start_Del += (v) => {
            UI.d.Update_Del(v);
        };
        UI.d.Update_Del += (v) => {
            UI.T.transform.position = v;
            Now_TPot = UI.T.transform.localPosition;
        };

        Now_User = MyCalculate.SpObj(Users [G0_MainUI._.UI.UserSet.UI.SexButt.Nob], transform, Vector3.one).GetComponent <G0_UserPlayUICon> ();
    }
Esempio n. 7
0
 public void SetP(int N)
 {
     if (N == 0)
     {
         MyCalculate.SpObj(NobObj.AllObj [0].obj, PUI.transform, Vector3.zero);
         return;
     }
     for (; N >= 1;)
     {
         MyCalculate.SpObj(NobObj.AllObj [N % 10].obj, PUI.transform, Vector3.zero);
         N /= 10;
     }
 }
Esempio n. 8
0
    public void OpenBox()
    {
        int n = GetAInt();

        if (n < 0)
        {
            // print ("所有箱子都生成了");
            return;
        }

        G0_Box _Box = MyCalculate.SpObj(Box, transform, Vector3.one).GetComponent <G0_Box> ();

        _Box.End_Del += () => { AllInt [n] = 1; };
        _Box.Open(AllT [n].transform.localPosition);
        AllInt [n] = 0;
    }
Esempio n. 9
0
    public void OpenLvUp(int Lv)
    {
        GameObject g = MyCalculate.SpObj(LvUpObjs [Lv], transform, LVUpDice.GetAT().transform.localPosition);

        g.name = "LvUp_" + Lv;
    }
Esempio n. 10
0
    void Start()
    {
        void SetPos(Vector3 v3)
        {
            if (Lines.Count <= 0)
            {
                return;
            }

            NowLine.positionCount++;
            NowLine.SetPosition(NowLine.positionCount - 1, v3);
            Mouse.position = v3;
        }

        DragButt.Start_Del += (v3) =>
        {
            Mouse.gameObject.SetActive(true);
            GameObject obj = MyCalculate.SpObj(LineObj.gameObject, transform, Vector3.zero);
            obj.transform.position = v3;
            Lines.Add(obj.GetComponent <LineRenderer>());

            SetPos(v3);
        };
        DragButt.Update_Del += (v3) =>
        {
            SetPos(v3);
        };
        DragButt.End_Del += (v3) =>
        {
            if (NowT.IsLast)
            {
                StartCoroutine(_End_Del());
            }
            Mouse.gameObject.SetActive(false);
        };
        IEnumerator _End_Del()//跳到下一畫必須要晚一偵執行避免半段錯誤
        {
            yield return(null);

            NowT.IsOK_2 = true;
            LoadNext();
            // print ("x");
        }

//==========================================================================================
        IEnumerator OX(string text)
        {
            Text.GetComponentsInChildren <Text> ()[1].text = text;
            yield return(new WaitForSeconds(1));

            Text.GetComponentsInChildren <Text> ()[1].text = "";
        }

        FallEvent += () =>
        {
            print("失敗!");
            StartCoroutine(OX("X"));
            ResetLine();
        };
        WinEvent += () =>
        {
            print("勝利!");
            StartCoroutine(OX("O"));
            ResetLine();
        };
        //Open (Data);
    }
Esempio n. 11
0
 public void SpImNob(Vector3 v3, int Lv, int n)
 {
     MyCalculate.SpObj(Nobs [Lv], transform, v3).GetComponent <Mobe_Nob> ().Open(n);
 }