Exemplo n.º 1
0
    [MenuItem(CZMToolConst.Menu_Root + "GroupGameObjects/Group打包(解除Group) %&g")]     //crtl+alt+g
    public static void GroupGameObject_DisGroup()
    {
        Object[] selectedObjects = Selection.objects;

        GameObject groupGameObject = selectedObjects[0] as GameObject;

        List <Transform> childrenTransformList = new List <Transform>();

        for (int i = 0; i < groupGameObject.transform.childCount; i++)
        {
            childrenTransformList.Add(groupGameObject.transform.GetChild(i));
        }

        Vector3 min = Vector3Const.Max;
        Vector3 max = Vector3Const.Min;

        GetMinMax(groupGameObject.transform, ref min, ref max);
        if (max == Vector3Const.Max)
        {
            LogCat.error("没有Meshes");
            return;
        }


        groupGameObject.transform.DetachChildren();

        groupGameObject.transform.position = (min + max) / 2;

        foreach (Transform transform in childrenTransformList)
        {
            transform.parent = groupGameObject.transform;
        }

        LogCat.log("GroupGameObjects finished");
    }
Exemplo n.º 2
0
    [MenuItem(CZMToolConst.Menu_Root + "GroupGameObjects/Group打包(中心) %g")]     //crtl+g
    public static void GroupGameObject_Center()
    {
        Object[]         selectedObjects = Selection.objects;
        List <Transform> transformList   = new List <Transform>();

        foreach (GameObject gameObject1 in selectedObjects)
        {
            bool isNeedToAdd = true;
            foreach (GameObject gameObject2 in selectedObjects)
            {
                if (gameObject1.transform.parent == gameObject2.transform)
                {
                    isNeedToAdd = false;
                    break;
                }
            }

            if (isNeedToAdd)
            {
                transformList.Add(gameObject1.transform);
            }
        }

        Vector3 min = Vector3Const.Max;
        Vector3 max = Vector3Const.Min;

        foreach (Transform transform in transformList)
        {
            GetMinMax(transform, ref min, ref max);
        }


        if (max == Vector3Const.Max)
        {
            LogCat.error("没有Meshes");
            return;
        }

        GameObject group = new GameObject();

        group.name = "Group";
        group.transform.position = (min + max) / 2;

        foreach (Transform transform in transformList)
        {
            transform.parent = group.transform;
        }

        LogCat.log("GroupGameObjects finished");
    }
Exemplo n.º 3
0
        public string ParseString(string expression)
        {
            LogCat.log(string.Format("解析ing:{0}", expression));
            //决定解析的先后顺序
            if (expression.IndexOf("${") != -1)
            {
                if (expression.IndexOf("$${") != -1)
                {
                    expression = expression.ReplaceAll(DoerAttrParserConst.Pattern3, Replace);
                }
                expression = expression.ReplaceAll(DoerAttrParserConst.Pattern2, Replace);
            }

            return(expression.ReplaceAll(DoerAttrParserConst.Pattern1, Replace));
        }
Exemplo n.º 4
0
        public static void Test()
        {
            DoerAttrParser doerAttrParser = new DoerAttrParser(Client.instance.user);
            var            result         = "";

            //    result = doerAttrParser.ParseString("{#u.pos2}");
            //    result = doerAttrParser.Parse("{eval((5+4)*6)}");//eval()
            //    result = doerAttrParser.Parse("{#cfgData.CfgItemData.1.icon_path}");//
            //    result = doerAttrParser.Parse("{@hasSubString(abcdef,de)}");//
            //   for (int i = 1; i < 100; i++)
            //   {
            //     result = doerAttrParser.Parse("{random(4,8)}"); //random()
            //     LogCat.log(result);
            //   }
            LogCat.log(result);
        }
Exemplo n.º 5
0
    [MenuItem(CZMToolConst.Menu_Root + "GroupGameObjects/Group打包(非中心) &g")]     //alt+g
    public static void GroupGameObject_NotCenter()
    {
        Object[]         selectedObjects = Selection.objects;
        List <Transform> transformList   = new List <Transform>();

        foreach (GameObject gameObject1 in selectedObjects)
        {
            bool isNeedToAdd = true;
            foreach (GameObject gameObject2 in selectedObjects)
            {
                if (gameObject1.transform.parent == gameObject2.transform)
                {
                    isNeedToAdd = false;
                    break;
                }
            }

            if (isNeedToAdd)
            {
                transformList.Add(gameObject1.transform);
            }
        }


        GameObject group = new GameObject();

        group.name = "Group";


        foreach (Transform transform in transformList)
        {
            transform.parent = group.transform;
        }

        LogCat.log("GroupGameObjects finished");
    }
Exemplo n.º 6
0
 public static void Test()
 {
     LogCat.log(NumberUnitUtil.GetString(300000, 2, 1000));
 }
Exemplo n.º 7
0
 public override void Enter(object[] args)
 {
     LogCat.log("Enter B_HFSMState", key);
     base.Enter(args);
 }
Exemplo n.º 8
0
 public override void Exit(object[] args)
 {
     LogCat.log("Exit B_HFSMState", key);
     base.Exit(args);
 }
Exemplo n.º 9
0
 protected override void _Update(float deltaTime = 0, float unscaledDeltaTime = 0)
 {
     base._Update(deltaTime, unscaledDeltaTime);
     LogCat.log("Execute B_HFSMState", key);
 }