Beispiel #1
0
 void Add()
 {
     Common.Auto.ThriftVector3 pos = new Common.Auto.ThriftVector3();
     m_Config.Path.Insert(++curPos, pos);
     helper.AddObj(curPos, pos.GetVector3());
     RefreshDisplayString();
 }
    public override EFuncRet FuncExecHandler(HandleTarget Target, FuncData funcdata, FuncContext context)
    {
        try
        {
            int id = funcdata.ParamIntList[0];

            ThriftVector3 pos = new ThriftVector3();
            pos.X = funcdata.ParamIntList[1];
            pos.Y = funcdata.ParamIntList[2];
            pos.Z = funcdata.ParamIntList[3];

            ThriftVector3 rot = new ThriftVector3();
            rot.X = 0;
            rot.Y = funcdata.ParamIntList[4];
            rot.Z = 0;

            ThriftVector3 scal = new ThriftVector3();
            scal.X = funcdata.ParamIntList[5];
            scal.Y = funcdata.ParamIntList[5];
            scal.Z = funcdata.ParamIntList[5];

            TerrainManager.Instance.CreateNpcById(id, pos, rot, scal);
        }
        catch (Exception)
        {
            Debuger.LogWarning("error on create npc by function ");
        }
        return EFuncRet.Continue;
    }
Beispiel #3
0
    protected void Init()
    {
        if (null != m_ActionFrameData)
        {
            m_fTime  = (float)m_ActionFrameData.Time;
            m_Config = m_ActionFrameData.MoveTransformFrame;
        }
        else
        {
            m_ActionFrameData = new ActionFrameData();
            m_Config          = new MoveTransformFrameConfig();
        }

        if (m_Config.Path == null || m_Config.Path.Count < 1)
        {
            m_Config.Path = new System.Collections.Generic.List <Common.Auto.ThriftVector3>();
            Common.Auto.ThriftVector3 origin = new Common.Auto.ThriftVector3();
            m_Config.Path.Add(origin);
        }
        RefreshDisplayString();

        var go = new GameObject();

        helper = go.AddComponent <MoveFrameHelper>();
        helper.Init(m_Config.Path);

        curPos  = 0;
        lastPos = curPos;
        Selection.activeGameObject = helper.GetNode(curPos).gameObject;


        m_Instance.minSize = new Vector2(WINDOW_MIN_WIDTH, WINDOW_MIN_HIEGHT);
    }
    public override EFuncRet FuncExecHandler(HandleTarget Target, FuncData funcdata, FuncContext context)
    {
        try
        {
            ThriftVector3 pos = new ThriftVector3();
            pos.X = funcdata.ParamIntList[0];
            pos.Y = funcdata.ParamIntList[1];
            pos.Z = funcdata.ParamIntList[2];

            ThriftVector3 rot = new ThriftVector3();
            rot.X = 0;
            rot.Y = funcdata.ParamIntList[3];
            rot.Z = 0;

            ThriftVector3 scal = new ThriftVector3();
            scal.X = funcdata.ParamIntList[4];
            scal.Y = funcdata.ParamIntList[4];
            scal.Z = funcdata.ParamIntList[4];
            GameObject elem = EffectContainer.EffectFactory(funcdata.ParamStringList[0]);
            elem.transform.position = pos.GetVector3();
            elem.transform.eulerAngles = rot.GetVector3();
            elem.transform.localScale = scal.GetVector3();
        }
        catch
        {

        }
        
        return EFuncRet.Continue;
    }
    protected void Init()
    {
        if (null != m_ActionFrameData)
        {
            m_fTime  = (float)m_ActionFrameData.Time;
            m_Config = m_ActionFrameData.Vector3Frame;
        }
        else
        {
            m_ActionFrameData = new ActionFrameData();
            m_Config          = new Common.Auto.ThriftVector3();
        }

        m_Instance.minSize = new Vector2(WINDOW_MIN_WIDTH, WINDOW_MIN_HIEGHT);
    }
    protected void Init()
    {
        if (null != m_ActionFrameData)
        {
            m_fTime = (float)m_ActionFrameData.Time;
            m_Config = m_ActionFrameData.Vector3Frame;
        }
        else
        {
            m_ActionFrameData = new ActionFrameData();
            m_Config = new Common.Auto.ThriftVector3();
        }

        m_Instance.minSize = new Vector2(WINDOW_MIN_WIDTH, WINDOW_MIN_HIEGHT);
    }
 void Add()
 {
     Common.Auto.ThriftVector3 pos = new Common.Auto.ThriftVector3();
     m_Config.Path.Insert(++curPos, pos);
     helper.AddObj(curPos,pos.GetVector3());
     RefreshDisplayString();
 }
    protected void Init()
    {
        if (null != m_ActionFrameData)
        {
            m_fTime = (float)m_ActionFrameData.Time;
            m_Config = m_ActionFrameData.MoveTransformFrame;
        }
        else
        {
            m_ActionFrameData = new ActionFrameData();
            m_Config = new MoveTransformFrameConfig();
        }

        if(m_Config.Path == null || m_Config.Path.Count < 1)
        {
            m_Config.Path = new System.Collections.Generic.List<Common.Auto.ThriftVector3>();
            Common.Auto.ThriftVector3 origin = new Common.Auto.ThriftVector3();
            m_Config.Path.Add(origin);
        }
        RefreshDisplayString();

        var go = new GameObject();
        helper = go.AddComponent<MoveFrameHelper>();
        helper.Init(m_Config.Path);

        curPos = 0;
        lastPos = curPos;
        Selection.activeGameObject = helper.GetNode(curPos).gameObject;


        m_Instance.minSize = new Vector2(WINDOW_MIN_WIDTH, WINDOW_MIN_HIEGHT);
    }
    private void DrawCharMove()
    {
        GUILayout.Space(5f);
        if (NGUIEditorTools.DrawHeader("路径节点"))
        {
            GUILayout.Space(5f);
            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Space(5f);
                EditorGUILayout.LabelField("节点数量:", GUILayout.Width(80f));
                GUILayout.Space(5f);
                m_nTargetNum = EditorGUILayout.IntField(m_nTargetNum, GUILayout.Width(50f));
                GUILayout.Space(15f);
                if (m_nTargetNum != m_nTargetLastNum)
                {
                    m_lstSpeedMoveList = new List<CharSpeedMove>();
                    m_lstLastTimePos = new List<Vector3>();
                    ClearHintPoint();
                    m_lstHintPointList = new List<GameObject>();
                    for (int i = 0; i < m_nTargetNum; i++)
                    {
                        // data
                        ThriftVector3 pos = new ThriftVector3();
                        pos.SetVector3(new Vector3(0, 0, 0));
                        CharSpeedMove point = new CharSpeedMove();
                        point.Target = pos;
                        point.Speed = 5;
                        m_lstSpeedMoveList.Add(point);
                        // state
                        m_lstLastTimePos.Add(new Vector3(0, 0, 0));
                        GameObject instance = GameObject.Instantiate(m_HintPointSource);
                        GameObject root = GameObject.Find("Canvas");
                        if (root)
                        {
                            ComponentTool.Attach(root.transform, instance.transform);
                            Text txtComp = instance.GetComponentInChildren<Text>();
                            if (txtComp)
                            {
                                txtComp.text = (i+1).ToString();
                            }
                        }
                        m_lstHintPointList.Add(instance);
                    }
                }
                EditorGUILayout.BeginVertical();
                {
                    if (m_lstSpeedMoveList != null && m_lstSpeedMoveList.Count > 0)
                    {
                        for (int i = 0; i < m_lstSpeedMoveList.Count; i++)
                        {
                            EditorGUILayout.BeginHorizontal();
                            {
                                GUILayout.Label("节点 " + (i + 1).ToString() + " : ", GUILayout.Width(80f));
                                Vector3 tmpPos = new Vector3(0, 0, 0);
                                if (m_lstSpeedMoveList[i].Target != null)
                                {
                                    tmpPos = m_lstSpeedMoveList[i].Target.GetVector3();
                                }

                                GUILayout.Label("x", GUILayout.Width(20f));
                                tmpPos.x = EditorGUILayout.FloatField(tmpPos.x);
                                GUILayout.Label("y", GUILayout.Width(20f));
                                tmpPos.y = EditorGUILayout.FloatField(tmpPos.y);
                                GUILayout.Label("z", GUILayout.Width(20f));
                                tmpPos.z = EditorGUILayout.FloatField(tmpPos.z);

                                if (m_lstLastTimePos[i] != tmpPos)
                                {
                                    m_lstSpeedMoveList[i].Target.SetVector3(tmpPos);
                                    //m_Config.LstTargets = m_lstTargetList;
                                }
                                GUILayout.Space(5f);
                                if (GUILayout.Button("调整位置", GUILayout.Width(100f)))
                                {
                                    m_nCurrentSettingPosTriggerIndex = i;
                                    ActionEditorRuntime.Instance.SetRaycastCallBack(SetTargetPos);
                                }
                                m_lstLastTimePos[i] = tmpPos;
                                GUILayout.Space(5f);
                                m_lstSpeedMoveList[i].Speed = EditorGUILayout.FloatField("速度:", (float)m_lstSpeedMoveList[i].Speed);

                            }
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();
        }
        m_nTargetLastNum = m_nTargetNum;
    }
 public ChangeColorFrame(ActionPlayer action, ActionFrameData data):base(action,data){
     color_config = m_FrameData.Vector3Frame;
 }
 public ChangeColorFrame(ActionPlayer action, ActionFrameData data) : base(action, data)
 {
     color_config = m_FrameData.Vector3Frame;
 }