예제 #1
0
        protected override void Load(ScriptableData.FunctionData funcData)
        {
            ScriptableData.CallData callData = funcData.Call;
            if (null != callData)
            {
                Load(callData);

                for (int i = 0; i < funcData.Statements.Count; i++)
                {
                    ScriptableData.CallData stCall = funcData.Statements[i] as ScriptableData.CallData;
                    if (null != stCall)
                    {
                        string id = stCall.GetId();
                        if (id == "stateimpact")
                        {
                            StateImpact stateimpact = TriggerUtil.ParseStateImpact(stCall);
                            m_StateImpacts[stateimpact.m_State] = stateimpact;
                        }
                        else if (id == "showtip")
                        {
                            m_IsShowTip = true;
                            m_ShowTime  = long.Parse(stCall.GetParamId(0));
                            if (stCall.GetParamNum() >= 4)
                            {
                                float r = float.Parse(stCall.GetParamId(1));
                                float g = float.Parse(stCall.GetParamId(2));
                                float b = float.Parse(stCall.GetParamId(3));
                                m_Color = new UnityEngine.Color(r, g, b, 1);
                            }
                        }
                    }
                }

                /*
                 * foreach (ScriptableData.ISyntaxComponent statement in funcData.Statements) {
                 * ScriptableData.CallData stCall = statement as ScriptableData.CallData;
                 * if (null != stCall) {
                 *  string id = stCall.GetId();
                 *  if (id == "stateimpact") {
                 *    StateImpact stateimpact = TriggerUtil.ParseStateImpact(stCall);
                 *    m_StateImpacts[stateimpact.m_State] = stateimpact;
                 *  } else if (id == "showtip") {
                 *    m_IsShowTip = true;
                 *    m_ShowTime = long.Parse(stCall.GetParamId(0));
                 *    if (stCall.GetParamNum() >= 4) {
                 *      float r = float.Parse(stCall.GetParamId(1));
                 *      float g = float.Parse(stCall.GetParamId(2));
                 *      float b = float.Parse(stCall.GetParamId(3));
                 *      m_Color = new Color(r, g, b, 1);
                 *    }
                 *  }
                 * }
                 * }*/
            }
        }
예제 #2
0
        private void LoadStateImpactConfig(ScriptableData.CallData stCall)
        {
            StateImpact stateimpact = TriggerUtil.ParseStateImpact(stCall);

            m_StateImpacts[stateimpact.m_State] = stateimpact;
        }