Exemplo n.º 1
0
    void InitAI()
    {
        if (mObj == null)
        {
            return;
        }

        int aiId = mObj.GetProperty("AI").GetInt();

        mCurAIProperty = XmlManager.Instance.GetAIProperty(aiId);
        if (mCurAIProperty == null)
        {
            return;
        }

        if (mCurAIProperty.mAIStageList == null)
        {
            return;
        }

        if (mCurAIProperty.mAIStageList.Count < 1)
        {
            return;
        }

        mCurAIActionType = mCurAIProperty.mAIStageList[0].mAIActionType;
    }
Exemplo n.º 2
0
    bool LoadAIProperty()
    {
        byte[] asset = ResourceManager.Instance.GetXml("AI");
        if (asset == null)
        {
            return(false);
        }

        TbXmlNode docNode = TbXml.Load(asset).docNode;

        if (docNode == null)
        {
            return(false);
        }

        List <TbXmlNode> xmlNodeList = docNode.GetNodes("AI/Property");
        int xmlNodeListLength        = xmlNodeList.Count;

        if (xmlNodeListLength < 1)
        {
            return(false);
        }

        for (int i = 0; i < xmlNodeListLength; ++i)
        {
            TbXmlNode  node = xmlNodeList[i] as TbXmlNode;
            AIProperty ap   = new AIProperty();
            ap.mAIId = UtilTools.IntParse(node.GetStringValue("Id"));

            //mAIPropertyDic.Add(ap.mAIId, text);
        }

        return(true);
    }
Exemplo n.º 3
0
    public void Reset()
    {
        _intelligence = AIProperty.intelligence;
        _latency      = AIProperty.latency;

        _elapsedTime = 0f;
        _isTime      = false;
    }
Exemplo n.º 4
0
    //생성자
    public AIElement(AIProperty __intelligence, AIProperty __latency)
    {
        _intelligence = AIProperty.intelligence;
        _latency      = AIProperty.latency;

        _elapsedTime = 0f;
        _isTime      = false;

        Set(__intelligence, __latency);
    }
Exemplo n.º 5
0
        public static AIProperty Latency(float _valueBasic)
        {
            AIProperty prop = AIProperty.latency;

            if (_valueBasic < 0.0f)
            {
                prop.basic = 0.0f;
            }

            else
            {
                prop.basic = _valueBasic;
            }

            return(prop);
        }
Exemplo n.º 6
0
        public static AIProperty Intelligence(float _valueBasic)
        {
            AIProperty prop = AIProperty.intelligence;

            if (_valueBasic >= 1.0f)
            {
                prop.basic = 1.0f;
            }

            else if (_valueBasic < 0.0f)
            {
                prop.basic = 0.0f;
            }

            else
            {
                prop.basic = _valueBasic;
            }

            return(prop);
        }
Exemplo n.º 7
0
 public void Set(AIProperty __intelligence, AIProperty __latency)
 {
     _intelligence = __intelligence;
     _latency      = __latency;
 }