public void UseParam(normalInfo ninfo)
 {
     m_normalInfo = ninfo;
 }
Exemple #2
0
 public static void NormalInfoToStack(ILuaState lua, normalInfo nor)
 {
     lua.NewTable();
     lua.PushNumber(nor.distance);
     lua.SetField(-2, "distance");
     lua.PushNumber(nor.rotationLR);
     lua.SetField(-2, "LRAngle");
     lua.PushNumber(nor.rotationUD);
     lua.SetField(-2, "UDAngle");
     Vector3ToStack(lua, nor.offSet);
     lua.SetField(-2, "offset");
 }
        public static void OnCameraInfoGUI(ref normalInfo norInfo, string expect = "", bool bCopy = true)
        {
            EditorGUILayout.BeginHorizontal();
            if (bCopy == true)
            {
                if (GUILayout.Button("P"))
                {
                    norInfo.distance = objMainCamera.distance;
                    norInfo.offSet = objMainCamera.offset;
                    norInfo.rotationLR = objMainCamera.LRAnge;
                    norInfo.rotationUD = objMainCamera.UDAngle;
                }
            }
            if (!expect.Contains("distance"))
                norInfo.distance = EditorGUILayout.FloatField("视 点 距 离", norInfo.distance);
            EditorGUILayout.EndHorizontal();
            if (!expect.Contains("offset"))
                norInfo.offSet = EditorGUILayout.Vector3Field("视 点 偏 移", norInfo.offSet);
            if (!expect.Contains("rotationUD"))
                norInfo.rotationUD = EditorGUILayout.FloatField("仰俯 偏转角度", norInfo.rotationUD);
            if (!expect.Contains("rotationLR"))
                norInfo.rotationLR = EditorGUILayout.FloatField("水平 偏转角度", norInfo.rotationLR);

        }
Exemple #4
0
        public static normalInfo GetNormalInfo(ILuaState lua, int dwIndex)
        {
            normalInfo nInfo = new normalInfo();
            lua.PushValue(dwIndex);
            lua.PushString("LRAngle");
            lua.GetTable(-2);
            nInfo.rotationLR = (float)lua.ToNumber(-1);
            lua.Pop(1);

            lua.PushString("UDAngle");
            lua.GetTable(-2);
            nInfo.rotationUD = (float)lua.ToNumber(-1);
            lua.Pop(1);

            lua.PushString("distance");
            lua.GetTable(-2);
            nInfo.distance = (float)lua.ToNumber(-1);
            lua.Pop(1);

            lua.PushString("offset");
            lua.GetTable(-2);
            nInfo.offSet = GetVector3(lua, -1);
            lua.Pop(1);

            lua.Pop(1);
            return nInfo;

        }