async Task CloudBoxVisibilityChanged()
        {
            if (CloudBox.Visible == false)
            {
                if (CloudBox.Margin.Left.CurrentValue == 150)
                {
                    CloudBox.Visible = true;
                    await Task.Delay(1000);


                    await CloudBox.Animate(new Animation
                    {
                        Duration = 1.Seconds(),
                        Change   = () => CloudBox.Animate(10.Seconds(), x => x.Margin(left: 50))
                    });

                    CloudBox.Visible = false;
                }
                else if (CloudBox.Margin.Left.CurrentValue == 50)
                {
                    CloudBox.Visible = true;
                    await Task.Delay(1000);

                    await CloudBox.Animate(new Animation
                    {
                        Duration = 1.Seconds(),
                        Change   = () => CloudBox.Animate(10.Seconds(), x => x.Margin(left: 150))
                    });

                    CloudBox.Visible = false;
                }
            }
        }
示例#2
0
文件: Cloud.cs 项目: frms/game-jams
    // Use this for initialization
    void Start()
    {
        isMoving    = (Random.value <= chanceToMove);
        actualSpeed = Random.Range(speed.x, speed.y);

        cb = transform.parent.GetComponent <CloudBox>();
    }
        public override async Task OnInitializing()
        {
            await base.OnInitializing();

            ForegroundStack.Y.Set(10);

            await CloudBox.Animate(new Animation
            {
                Change  = () => CloudBox.Animate(2.Seconds(), x => x.Margin(left: 70), x => x.Visible = false),
                Repeats = 100
            });
        }
        public override async Task OnInitializing()
        {
            await base.OnInitializing();

            ForegroundStack.Y.Set(10);

            await SunBox.Animate(new Animation
            {
                Duration = 100000.Milliseconds(),
                Change   = () => SunBox.Rotation(360),
                Repeats  = 600
            });

            await CloudBox.Animate(new Animation
            {
                Change  = () => CloudBox.Animate(2.Seconds(), x => x.Margin(left: 150), x => x.Visible = false),
                Repeats = 100
            });
        }
示例#5
0
        private GameObject CreateCloudPoint(List <float[]> collumnDataList, string file_path = null, bool isJSON = false, string json_path = null, int SMAPcolorcolumn = 100, bool isSMAP = false)
        {
            GameObject container = Instantiate(_cloudPointPrefab) as GameObject;      /// GameObject that is the parent of the CloudPoint (used for CloudParent offset)
            GameObject root      = container.transform.Find("CloudPoint").gameObject; /// GameObject where the mesh will be displayed

            // Init Cloud Status and references
            CloudData rootdata = root.GetComponent <CloudData>();

            rootdata.columnData = collumnDataList;

            if (isJSON && json_path != null)
            {
                LoadJSON(json_path, rootdata);
            }
            else
            {
                int[] intarray = new int[9] {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                };
                for (int i = 0; i < collumnDataList.Count; i++)
                {
                    if (i < intarray.Length)
                    {
                        intarray[i] = i;
                    }
                }

                rootdata.globalMetaData.displayCollumnsConfiguration = intarray;

                /**
                 * Vincent Casamayou 13/05/2020 - SMAP COMMUNICATION
                 * - Affect Color Coding to the specified Column in SMAP
                 * - Add a display/hide bool to the data table for each point
                 **/

                if (SMAPcolorcolumn != 100)
                {
                    rootdata.globalMetaData.displayCollumnsConfiguration[3] = SMAPcolorcolumn;
                }

                rootdata.globalMetaData.displayCollumnsConfiguration[8] = 5;
            }
            for (int i = 0; i < collumnDataList[0].Length; i++)
            {
                rootdata.CreatePointData(i, Vector3.zero, Vector3.zero, 0f, 0f, 0f, Color.black, 0f);

                rootdata.CreatePointMetaData(i, 0);
            }

            LoadCloudData(rootdata, file_path, isJSON, isSMAP);

            root.name = "CloudPoint";
            root.transform.position   = container.transform.position;
            root.transform.localScale = new Vector3(1, 1, 1);

            CloudBox box = root.AddComponent <CloudBox>();

            box.Activate();


            container.GetComponent <CloudObjectRefference>().cloud = root;
            return(root);
        }
示例#6
0
        private GameObject CreateCloudPoint(List <float[]> columnDataList, string file_path = null, bool isJSON = false, string json_path = null)
        {
            GameObject container = Instantiate(_cloudPointPrefab) as GameObject;      /// GameObject that is the parent of the CloudPoint (used for CloudParent offset)
            GameObject root      = container.transform.Find("CloudPoint").gameObject; /// GameObject where the mesh will be displayed

            // Init Cloud Status and references
            CloudData rootdata = root.GetComponent <CloudData>();

            rootdata.columnData = columnDataList;

            if (isJSON && json_path != null)
            {
                LoadJSON(json_path, rootdata);
            }
            else
            {
                int[] intarray = new int[9] {
                    0, 0, 0, 0, 0, 0, 0, 0, 0
                };
                for (int i = 0; i < columnDataList.Count; i++)
                {
                    if (i < intarray.Length)
                    {
                        intarray[i] = i;
                    }
                }

                rootdata.globalMetaData.displayCollumnsConfiguration = intarray;
            }

            for (int j = 0; j < columnDataList.Count; j++)
            {
                ColumnMetadata metadata = new ColumnMetadata();
                metadata.ColumnID     = j;
                metadata.MinValue     = Mathf.Infinity;
                metadata.MaxValue     = Mathf.NegativeInfinity;
                metadata.Range        = 0;
                metadata.MinThreshold = 0;
                metadata.MaxThreshold = 0;
                rootdata.globalMetaData.columnMetaDataList.Add(metadata);
            }

            for (int i = 0; i < columnDataList[0].Length; i++)
            {
                rootdata.CreatePointData(i, Vector3.zero, Vector3.zero, 0f, 0f, 0f, Color.black, 0f);

                rootdata.CreatePointMetaData(i, 0);

                for (int j = 0; j < columnDataList.Count; j++)
                {
                    float nbr = columnDataList[j][i];
                    if (nbr < rootdata.globalMetaData.columnMetaDataList[j].MinValue)
                    {
                        rootdata.globalMetaData.columnMetaDataList[j].MinValue = nbr;
                    }

                    if (nbr > rootdata.globalMetaData.columnMetaDataList[j].MaxValue)
                    {
                        rootdata.globalMetaData.columnMetaDataList[j].MaxValue = nbr;
                    }
                }
                foreach (ColumnMetadata md in rootdata.globalMetaData.columnMetaDataList)
                {
                    md.MaxThreshold = md.MaxValue;
                    md.MinThreshold = md.MinValue;
                    md.Range        = md.MaxValue - md.MinValue;
                }
            }

            LoadCloudData(rootdata, file_path, isJSON);

            root.name = "CloudPoint";
            root.transform.position   = container.transform.position;
            root.transform.localScale = new Vector3(1, 1, 1);

            CloudBox box = root.AddComponent <CloudBox>();

            box.Activate();


            container.GetComponent <CloudObjectRefference>().cloud = root;
            return(root);
        }