Пример #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);
        }
    }
Пример #2
0
    void Start()
    {
        if (AllPhoto == null)
        {
            AllPhoto = new List <G0_Photo_UICon> ();
        }
        AllPhoto.Add(this);

        Start_parent       = transform.parent;
        UI.Butt.Start_Del += (V3) => {
            Now = this;
            G0_Target_UICOn.Now = null;

            transform.SetParent(Start_parent.parent);
            transform.SetSiblingIndex(2);
        };
        UI.Butt.Start_Del += (V3) => {
            // UI.Butt.F_V3 = Vector3.zero;
        };
        UI.Butt.End_Del   += (V3) => {
            Now = null;

            if (IsOK)
            {
                G0_Target_UICOn.Now.Open();
                // print ("特效開始");
                transform.SetSiblingIndex(G0_Play_UICon._.UI.Target_Parent.transform.GetSiblingIndex() + 1);
                UI.Tween.Time_Length = 0.3f;
                Tween_Position tween_Position = UI.Tween.All_Tween [0] as Tween_Position;
                Tween_Size     tween_Size     = UI.Tween.All_Tween [1] as Tween_Size;
                Tween_Rotation tween_Rotation = UI.Tween.All_Tween [2] as Tween_Rotation;

                tween_Size.From     = Vector3.one * 2;
                tween_Size.To       = Vector3.zero;
                tween_Position.From = transform.localPosition;
                tween_Position.To   = G0_Target_UICOn.Now.transform.localPosition;
                tween_Rotation.To   = new Vector3(0, 0, 360);

                UI.Tween.Play(true, 1);

                GetComponent <Image> ().raycastTarget = false;
            }
            else
            {
                Vector3        v3             = transform.localPosition;
                Tween_Position tween_Position = UI.Tween.All_Tween [0] as Tween_Position;
                tween_Position.From = v3;
                tween_Position.To   = new Vector3(761, v3.y, 0);
                UI.Tween.Play(true);
            }
        };
        UI.Tween.End_Del = () => {
            // print (G0_Target_UICOn.Now != null);
            if (!GetComponent <Image> ().raycastTarget)
            {
                // print ("特效結束");
                End();
            }
            else
            {
                transform.SetParent(Start_parent);
                Set_Transform_Count();
            }
        };
    }