示例#1
0
    /// <summary>
    /// 初始化 找到前面背景各32张图
    /// </summary>
    void InitMethod()
    {
        int count = Force.transform.childCount;//count==32;

        for (int i = 0; i < count / 8; i++)
        {
            //4row 4个list
            List <GameObject> list = new List <GameObject>();
            //8列 column
            for (int k = 0; k < count / 4; k++)
            {
                //根据二维坐标计算,(0,0)(0,1)(r,c)(当前r*总列数+当前列数);总列数为:固定值;
                list.Add(Force.transform.GetChild(k + i * 8).gameObject);
            }
            ForceList.Add(list);
        }

        count = Back.transform.childCount;
        for (int i = 0; i < count / 8; i++)
        {
            List <GameObject> list = new List <GameObject>();
            for (int k = 0; k < count / 4; k++)
            {
                list.Add(Back.transform.GetChild(k + i * 8).gameObject);
            }
            BackList.Add(list);
        }
    }
示例#2
0
        public void AddOval()
        {
            Random rnd = new Random();
            int    x   = rnd.Next(100, 1000);
            int    y   = rnd.Next(100, 600);

            ElipseShape rect = new ElipseShape(new Rectangle(x, y, 100, 100));

            rect.FillColor = Color.White;

            ShapeList.Add(rect);
            BackList.Add(rect);
        }
示例#3
0
        public void AddRectMercedes()
        {
            Random rnd = new Random();
            int    x   = rnd.Next(100, 1000);
            int    y   = rnd.Next(100, 600);

            RectMercedes rect = new RectMercedes(new Rectangle(x, y, 200, 100));

            rect.FillColor = Color.White;

            ShapeList.Add(rect);
            BackList.Add(rect);
        }
示例#4
0
        public static void AddExercise(string type, string entry)
        {
            ExerciseModel newExercise = new ExerciseModel();

            newExercise.Name = entry;

            List <LogModel> newData = new List <LogModel>();
            LogModel        data1   = new LogModel();

            data1.Reps    = 0;
            data1.Sets    = 0;
            data1.Weights = 0;
            data1.Trend   = 0;
            data1.Date    = DateTime.Now.ToString("dd/MM/yy");
            newData.Add(data1);

            newExercise.Data = newData;

            if (type == "Chest")
            {
                ChestList.Add(newExercise);
            }
            else if (type == "Back")
            {
                BackList.Add(newExercise);
            }
            else if (type == "Legs")
            {
                LegsList.Add(newExercise);
            }
            else if (type == "Shoulders")
            {
                ShouldersList.Add(newExercise);
            }
            else if (type == "Arms")
            {
                ArmsList.Add(newExercise);
            }
            else if (type == "Abs")
            {
                AbsList.Add(newExercise);
            }

            App.Current.MainPage.Navigation.PopToRootAsync();
            Application.Current.MainPage.Navigation.PushAsync(new WorkoutLogger.Views.ExerciseListPage(type));
            DataService.UserDataService.SaveData();
        }