コード例 #1
0
ファイル: Main.cs プロジェクト: alina-gmc/Overcooked-cooker
        private ContainerInfo getContainerInfo(ServerIngredientContainer container)
        {
            ContainerInfo cInfo = new ContainerInfo();

            cInfo.name = container.name;
            cInfo.id   = container.gameObject.GetInstanceID().ToString();
            cInfo.p    = new ContainerInfo.Position();
            Vector3 cPos = getContainerPosition(container);

            cInfo.p.x           = Math.Round(cPos.x, 2);
            cInfo.p.y           = Math.Round(cPos.y, 2);
            cInfo.p.z           = Math.Round(cPos.z, 2);
            cInfo.hasIngredient = ContainerUtil.HasIngredient(container);
            if (cInfo.hasIngredient == false)
            {
                cInfo.ingredient = "None";
            }
            else
            {
                cInfo.ingredient = ContainerUtil.GetIngredient(container);
            }
            return(cInfo);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: alina-gmc/Overcooked-cooker
        private Vector3 getContainerPosition(ServerIngredientContainer container)
        {
            Vector3 containerPos = ContainerUtil.GetContainerPosition(container);

            return(containerPos);
        }