Beispiel #1
0
    private void LoadCallBack(HandlerParam p_handleParam)
    {
        if (p_handleParam.assetObj == null)
        {
            return;
        }

        object[] paramArr = (object[])p_handleParam.paramObj;

        int     npcID    = (int)paramArr[0];
        string  unitName = (string)paramArr[1];
        Camp    camp     = (Camp)paramArr[2];
        Vector3 position = (Vector3)paramArr[3];

        GameObject go = GameObject.Instantiate(p_handleParam.assetObj) as GameObject;

        go.transform.position = position;
        go.name = unitName;

        GoapAgent goapAgent = go.GetComponent <GoapAgent>();

        goapAgent.Camp  = camp;
        goapAgent.NpcID = npcID;

        UnitManager.AddMonster(goapAgent);
    }