コード例 #1
0
    public void AllocateIntoMapTriger(int _questID, int _intoCount, AchMapInto _mapInto)
    {
        LoadModel();

        GameObject objTrigger         = GameObject.Instantiate(objModel) as GameObject;
        objTrigger.transform.position = new Vector3(_mapInto.MapLocationX, _mapInto.MapLocationY, _mapInto.MapLocationZ);
        objTrigger.transform.parent   = transform;
        objTrigger.layer              = LayerMask.NameToLayer("Hide");

        QuestIntoMapTrigger trigger = objTrigger.AddComponent<QuestIntoMapTrigger>();
        trigger.questTableID        = _questID;
		trigger.mapInfo             = _mapInto;
        trigger.radius              = _mapInto.MapLocationRadius;

        SphereCollider collider = objTrigger.GetComponent<SphereCollider>();//objTrigger.AddComponent<SphereCollider>();

        if (collider == null)
            collider = objTrigger.AddComponent<SphereCollider>();

        collider.radius    = _mapInto.MapLocationRadius / objTrigger.transform.localScale.x;
        collider.isTrigger = true;

        // add
		if (dicIntoMapTriger.ContainsKey(_questID))
		{
			dicIntoMapTriger[_questID].Add(_mapInto.AchievementNum, objTrigger);
			dicIntoMapInfo[_questID].Add(_mapInto.AchievementNum, _mapInto);
		}
		else
		{
			dicIntoMapTriger.Add(_questID, new Dictionary<int, GameObject>());
			dicIntoMapInfo.Add(_questID, new Dictionary<int, AchMapInto>());
			dicIntoMapTriger[_questID].Add(_mapInto.AchievementNum, objTrigger);
			dicIntoMapInfo[_questID].Add(_mapInto.AchievementNum, _mapInto);
		}
    }
コード例 #2
0
ファイル: AsCommonProcess.cs プロジェクト: ftcaicai/ArkClient
    private void Quest_Clear_EnterMap_Result(byte[] _packet)
    {
        body_SC_QUEST_CLEAR_ENTER_MAP_RESULT data = new body_SC_QUEST_CLEAR_ENTER_MAP_RESULT();

        Debug.Log("Clear enter map");

        data.PacketBytesToClass(_packet);
        AchMapInto achMapInto = new AchMapInto(data.nQuestTableIdx);
        achMapInto.AchievementNum = data.nCond;
        QuestMessageBroadCaster.BrocastQuest(QuestMessages.QM_MAP_INTO, achMapInto);
    }