示例#1
0
	public void ClickObject( int iGroupIndex, AsNpcEntity npcObject, Vector3 vec3Target )
	{
		ObjStepping objStepping = GetObjStepping( iGroupIndex );
		if( null == objStepping )
		{
			Debug.LogError("null == objStepping");
			return;
		}
		
		objStepping.ClickObject( npcObject, vec3Target );
	}
示例#2
0
 public void InsertObjStepping(int iGroupIndex, int iLinkIndex, AsNpcEntity npcEntity)
 {
     if (true == m_ObjSteppingList.ContainsKey(iGroupIndex))
     {
         m_ObjSteppingList[iGroupIndex].AddObjEntity(iLinkIndex, npcEntity);
     }
     else
     {
         m_ObjSteppingList.Add(iGroupIndex, new ObjStepping(iGroupIndex, iLinkIndex, npcEntity));
     }
 }
示例#3
0
	void Awake()
	{
		m_ComponentType = eComponentType.FSM_MONSTER;

		m_PetEntity = GetComponent<AsNpcEntity>();
		if( m_PetEntity == null)
			Debug.LogError( "AsPetFsm::Init: no user entity attached");
		m_PetEntity.FsmType = eFsmType.PET;		
		
		#region - msg -
		MsgRegistry.RegisterFunction( eMessageType.MODEL_LOADED, OnModelLoaded);
		MsgRegistry.RegisterFunction( eMessageType.MOVE_NPC_INDICATION, OnMoveIndication);
		MsgRegistry.RegisterFunction( eMessageType.MOVE_END_INFORM, OnMoveEnd);
		
		MsgRegistry.RegisterFunction( eMessageType.ANIMATION_END, OnAnimationEnd);
		
		MsgRegistry.RegisterFunction( eMessageType.BALLOON, OnBalloonIndicate);
		
		MsgRegistry.RegisterFunction( eMessageType.PET_DATA_INDICATE, OnPetDataIndicate);
		MsgRegistry.RegisterFunction( eMessageType.PET_SKILL_READY, OnPetSkillReady);
		MsgRegistry.RegisterFunction( eMessageType.PET_SKILL_RESULT, OnPetSkillResult);
		
		MsgRegistry.RegisterFunction( eMessageType.PET_NAME_CHANGE, OnPetNameChange);
		MsgRegistry.RegisterFunction( eMessageType.PET_SKILL_CHANGE_RESULT, OnPetSkillChangeResult);
		
		MsgRegistry.RegisterFunction( eMessageType.PET_HATCH, OnHatch);
		MsgRegistry.RegisterFunction( eMessageType.PET_FEEDING, OnFeeding);
		MsgRegistry.RegisterFunction( eMessageType.PET_SCRIPT, OnPetScript);
		MsgRegistry.RegisterFunction( eMessageType.PET_LEVELUP, OnPetLevelUp);
		MsgRegistry.RegisterFunction( eMessageType.PET_EVOLUTION, OnPetEvolution);
		MsgRegistry.RegisterFunction( eMessageType.PET_SKILL_GET, OnPetSkillGet);
		MsgRegistry.RegisterFunction( eMessageType.PET_POSITION_REFRESH, OnPetPositionRefresh);
		MsgRegistry.RegisterFunction( eMessageType.PET_HUNGRY_INDICATE, OnPetHungryIndicate);
		#endregion
		#region - state -
		m_dicFsmState.Add( ePetFsmStateType.HATCH, new AsPetState_Hatch( this));
		m_dicFsmState.Add( ePetFsmStateType.DISPLAY, new AsPetState_Display( this));
		m_dicFsmState.Add( ePetFsmStateType.IDLE, new AsPetState_Idle( this));
		m_dicFsmState.Add( ePetFsmStateType.RUN, new AsPetState_Run( this));

		m_dicFsmState.Add( ePetFsmStateType.SKILL_READY, new AsPetState_SkillReady( this));
		m_dicFsmState.Add( ePetFsmStateType.SKILL_HIT, new AsPetState_SkillHit( this));
		m_dicFsmState.Add( ePetFsmStateType.SKILL_FINISH, new AsPetState_SkillFinish( this));
		#endregion
	}
示例#4
0
	void Awake()
	{
		m_ComponentType = eComponentType.FSM_COLLECTION;

		m_CollectionEntity = GetComponent<AsNpcEntity>();
		if( m_CollectionEntity == null)
			Debug.LogError( "AsCollectionFsm::Init: no other user entity attached");
		m_CollectionEntity.FsmType = eFsmType.COLLECTION;

		MsgRegistry.RegisterFunction( eMessageType.NPC_CLICK, OnNpcClick);
		MsgRegistry.RegisterFunction( eMessageType.COLLECT_START, OnCollectStart);
		MsgRegistry.RegisterFunction( eMessageType.COLLECT_INFO, OnCollectInfo);
		MsgRegistry.RegisterFunction( eMessageType.MODEL_LOADED, FishLoadModel);
		MsgRegistry.RegisterFunction( eMessageType.MODEL_LOADED_DUMMY, FishLoadModelDummy);

		m_dicFsmState.Add( eCollectionFsmStateType.IDLE, new AsCollectionState_Idle( this));
		m_dicFsmState.Add( eCollectionFsmStateType.ING, new AsCollectionState_Ing( this));
		m_dicFsmState.Add( eCollectionFsmStateType.SUCC, new AsCollectionState_Succ( this));
		m_dicFsmState.Add( eCollectionFsmStateType.FAILED, new AsCollectionState_Failed( this));
	}
示例#5
0
	void Awake()
	{
		m_ComponentType = eComponentType.FSM_NPC;
		
		m_NpcEntity = GetComponent<AsNpcEntity>();
		if(m_NpcEntity == null) Debug.LogError("AsMonsterFsm::Init: no user entity attached");
		m_NpcEntity.FsmType = eFsmType.NPC;
		
//		MsgRegistry.RegisterFunction(eMessageType.CLICKED, OnClicked);
        MsgRegistry.RegisterFunction(eMessageType.MODEL_LOADED, FishLoadModel);
		MsgRegistry.RegisterFunction(eMessageType.MODEL_LOADED_DUMMY, FishLoadModelDummy);
		MsgRegistry.RegisterFunction(eMessageType.MOVE_NPC_INDICATION, OnMoveIndication);
		MsgRegistry.RegisterFunction(eMessageType.MOVE_END_INFORM, OnMoveEnd);
		MsgRegistry.RegisterFunction(eMessageType.NPC_BEGIN_DIALOG, OnNpcBeginDialog);
		
		m_dicFsmState.Add(eNpcFsmStateType.IDLE, new AsNpcState_Idle(this));
		m_dicFsmState.Add(eNpcFsmStateType.ACCOST, new AsNpcState_Accost(this));
		m_dicFsmState.Add(eNpcFsmStateType.POPUP, new AsNpcState_Popup(this));
		m_dicFsmState.Add(eNpcFsmStateType.WALK, new AsNpcState_Walk(this));
		m_dicFsmState.Add(eNpcFsmStateType.PORTAL, new AsNpcState_Portal(this));
	}
示例#6
0
	public void RemoveEntity( AsNpcEntity _entity)
	{
		m_dicNpcEntity_SessionId.Remove( _entity.SessionId);
		m_dicEntity_InstanceId.Remove( _entity.gameObject.GetInstanceID());

		AsUseItemToTargetPanelManager.instance.DeletePanel( _entity);
		
		if( _entity.isSegregate == false)
		{
			RequestDestroy( _entity);
	
			UnloadAssetsForMemory();
		}
		else
			Destroy( _entity.gameObject);
	}
示例#7
0
	public static void SetQuestMarkPanel(AsNpcEntity _npcEntity, QuestMarkType _markType)
	{
		if (_npcEntity != null)
		{
			if (_npcEntity.questPanel != null)
				_npcEntity.questPanel.SetMarkType(_markType);
		}
	}
示例#8
0
	private QuestMarkType CheckInGameEvent(int _npcID, AsUserEntity _userEntity, AsNpcEntity _npcEntity)
	{
		// check have event
		List<Tbl_Event_Record> listEvent = AsTableManager.Instance.GetTbl_Event(_npcID, System.DateTime.Now.AddTicks(AsGameMain.serverTickGap));
		List<Tbl_Event_Record> listFiltered = new List<Tbl_Event_Record>();

		// filter list view
		foreach (Tbl_Event_Record record in listEvent)
		{
			if (record.viewList == true)
				continue;

			listFiltered.Add(record);
		}

		if (listFiltered.Count > 0)
		{
			// check have event and progress
			foreach (Tbl_Quest_Record questRecord in listQuestRecord)
			{
				if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IN)
				{
					QuestData questData = questRecord.QuestDataInfo;

					if (ArkQuest.IsPossibleAccept(_userEntity, questData) == true)
					{
						nowQuetMarkType = QuestMarkType.HAVE_EVENT_AND_PROGRESS;
						SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT_AND_PROGRESS);
						return nowQuetMarkType;
					}
				}
			}

			nowQuetMarkType = QuestMarkType.HAVE_EVENT;
			SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT);
			return nowQuetMarkType;
		}
		else
		{
			return QuestMarkType.NOTHING;
		}
	}
示例#9
0
	public float GetNearestNpcForPStore( Vector3 _pos, out AsNpcEntity _npc)
	{
		_npc = null;
		float nearestDistance = float.MaxValue;

		foreach( KeyValuePair<int, AsNpcEntity> pair in m_dicNpcEntity_SessionId)
		{
			Tbl_NormalNpc_Record record = AsTableManager.Instance.GetTbl_NormalNpc_Record( pair.Value.TableIdx);

			if( record.EnablePStore == true)
				continue;

			float dist = Vector3.Distance( pair.Value.transform.position, _pos);
			if( pair.Value.gameObject.layer == LayerMask.NameToLayer( "Npc") && dist < nearestDistance)
			{
				nearestDistance = dist;
				_npc = pair.Value;
			}
		}

		return nearestDistance;
	}
示例#10
0
	public Msg_NpcAttackChar1( AS_SC_NPC_ATTACK_CHAR_1 _info)
	{
		m_MessageType = eMessageType.NPC_ATTACK_CHAR1;

		npcId_ = _info.nNpcIdx;

		sessionId_ = _info.nSessionIdx;
		charUniqKey_ = _info.nCharUniqKey;

		hpCur_ = _info.nHpCur;

		attacker_ = AsEntityManager.Instance.GetNpcEntityBySessionId( npcId_);
		skillLv_ = AsTableManager.Instance.GetTbl_MonsterSkillLevel_Record( _info.nMonsterSkillLevelTableIdx);
		skill_ = AsTableManager.Instance.GetTbl_MonsterSkill_Record( skillLv_.Skill_GroupIndex);
		action_ = AsTableManager.Instance.GetTbl_MonsterAction_Record( skillLv_.SkillAction_Index);

		casting_ = _info.bCasting;
		castingMilliSec_ = _info.nCastingMilliSec;
		ready_ = _info.bReady;

		if( true == casting_)
			Debug.Log( "true == casting_");

		foreach( AS_SC_NPC_ATTACK_CHAR_2 attack2 in _info.bodyChar)
		{
			bodyChar_.Add( new Msg_NpcAttackChar2( this, attack2));
		}

		foreach( AS_SC_NPC_ATTACK_CHAR_3 attack3 in _info.bodyNpc)
		{
			bodyNpc_.Add( new Msg_NpcAttackChar3( this, attack3));
		}
	}
示例#11
0
	void Awake()
	{
		m_ComponentType = eComponentType.FSM_MONSTER;

		m_MonsterEntity = GetComponent<AsNpcEntity>();
		if( m_MonsterEntity == null)
			Debug.LogError( "AsMonsterFsm::Init: no user entity attached");
		m_MonsterEntity.FsmType = eFsmType.MONSTER;		
		
		#region - msg -
		MsgRegistry.RegisterFunction( eMessageType.MODEL_LOADED, OnModelLoaded);
		MsgRegistry.RegisterFunction( eMessageType.MOVE_NPC_INDICATION, OnMoveIndication);
		MsgRegistry.RegisterFunction( eMessageType.MOVE_END_INFORM, OnMoveEnd);
		MsgRegistry.RegisterFunction( eMessageType.NPC_ATTACK_CHAR1, OnAttackIndication);
		MsgRegistry.RegisterFunction( eMessageType.HIT_EXECUTION, OnHitExecution);
//		MsgRegistry.RegisterFunction( eMessageType.INPUT, OnClickedByPlayer);

		MsgRegistry.RegisterFunction( eMessageType.CHAR_ATTACK_NPC2, OnDamaged);
		MsgRegistry.RegisterFunction( eMessageType.NPC_ATTACK_CHAR3, OnAffected);
		MsgRegistry.RegisterFunction( eMessageType.ANIMATION_END, OnAnimationEnd);
		MsgRegistry.RegisterFunction( eMessageType.MOB_COMBAT_FREE, OnCombatFree);
		MsgRegistry.RegisterFunction( eMessageType.NPC_STATUS, OnNpcStatus);

		//SKILL EFFECT
		MsgRegistry.RegisterFunction( eMessageType.NPC_SKILL_EFFECT, OnSkillEffect);

		//BUFF
		MsgRegistry.RegisterFunction( eMessageType.NPC_BUFF, OnBuff);
		MsgRegistry.RegisterFunction( eMessageType.NPC_DEBUFF, OnDeBuff);
		MsgRegistry.RegisterFunction( eMessageType.BUFF_INCLUSION, OnBuffInclusion);
		MsgRegistry.RegisterFunction( eMessageType.CHAR_DEBUFF_RESIST, OnDebuffResist);

		//ATTRIBUTE
		MsgRegistry.RegisterFunction( eMessageType.ATTACK_SPEED_REFRESH, OnAttackSpeedRefresh);

		//CONDITION
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_STUN, OnConditionStun);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_STUN, OnRecoverConditionStun);
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_FREEZE, OnConditionFreeze);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_FREEZE, OnRecoverConditionFreeze);
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_SLEEP, OnConditionSleep);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_SLEEP, OnRecoverConditionSleep);
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_SIZECONTROL, OnConditionSizeControl);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_SIZECONTROL, OnRecoverConditionSizeControl);
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_FEAR, OnConditionFear);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_FEAR, OnRecoverConditionFear);
		
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_AIRBONE, OnConditionAirBone);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_AIRBONE, OnRecoverConditionAirBone);
		MsgRegistry.RegisterFunction( eMessageType.CONDITION_TRANSFORM, OnConditionTransform);
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_CONDITION_TRANSFORM, OnRecoverConditionTransform);

		//exception
		MsgRegistry.RegisterFunction( eMessageType.RECOVER_STATE, OnRecoverState);

		//death by other reason( ex. buff)
		MsgRegistry.RegisterFunction( eMessageType.DEATH_INDICATION, OnDeath);

		MsgRegistry.RegisterFunction( eMessageType.SHAKE_INDICATION, OnShake);
		
		MsgRegistry.RegisterFunction( eMessageType.BALLOON, OnBalloonIndicate);
		#endregion
		#region - state -
		m_dicFsmState.Add( eMonsterFsmStateType.APPEAR, new AsMonsterState_Appear( this));
		m_dicFsmState.Add( eMonsterFsmStateType.IDLE, new AsMonsterState_Idle( this));
		m_dicFsmState.Add( eMonsterFsmStateType.RUN, new AsMonsterState_Run( this));
		m_dicFsmState.Add( eMonsterFsmStateType.DEATH, new AsMonsterState_Death( this));

		m_dicFsmState.Add( eMonsterFsmStateType.SKILL_READY, new AsMonsterState_SkillReady( this));
		m_dicFsmState.Add( eMonsterFsmStateType.SKILL_HIT, new AsMonsterState_SkillHit( this));
		m_dicFsmState.Add( eMonsterFsmStateType.SKILL_FINISH, new AsMonsterState_SkillFinish( this));

		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_STUN, new AsMonsterState_Condition_Stun( this));
		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_FREEZE, new AsMonsterState_Condition_Freeze( this));
		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_SLEEP, new AsMonsterState_Condition_Sleep( this));
		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_FEAR, new AsMonsterState_Condition_Fear( this));
		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_AIRBONE, new AsMonsterState_Condition_AirBone( this));
		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_TRANSFORM, new AsMonsterState_Condition_Transform( this));

		m_dicFsmState.Add( eMonsterFsmStateType.CONDITION_FORCEDMOVE, new AsMonsterState_Condition_ForcedMove( this));
		#endregion
	}
示例#12
0
	void OnPetEvolution( AsIMessage _msg)
	{
		AsEntityManager.Instance.RemovePet( m_Pet);
		
		m_Pet = AsEntityManager.Instance.PetAppear( m_PetData.data_);
		m_Pet.HandleMessage( m_PetData);
		
		if(m_PetItem != null)
			m_Pet.SetPetItemView( m_PetItem);
		
		StartCoroutine( HatchPerform());
	}
示例#13
0
     // Awake
    void Awake()
    {
        m_ComponentType = eComponentType.FSM_OBJECT;
		
		m_ObjectEntity = GetComponent<AsNpcEntity>();
        if (m_ObjectEntity == null) Debug.LogError("AsObjectFsm::Init: no user entity attached");
		m_ObjectEntity.FsmType = eFsmType.OBJECT;
        
        MsgRegistry.RegisterFunction(eMessageType.ANIMATION_END, OnAnimationEnd);			
        MsgRegistry.RegisterFunction(eMessageType.OBJ_BREAK_MSG, OnObjectBreak);      
		MsgRegistry.RegisterFunction(eMessageType.OBJ_TRAP_MSG, OnObjectTrap);
        MsgRegistry.RegisterFunction(eMessageType.OBJ_STEPPING_MSG, OnObjectStepping);
		MsgRegistry.RegisterFunction(eMessageType.NPC_CLICK, OnNpcClick);
		MsgRegistry.RegisterFunction(eMessageType.NPC_BEGIN_DIALOG, OnNpcBeginDialog);
    }
示例#14
0
	public bool Open( AsBaseEntity target , bool _callFromQuestClear = false)
	{
		AsChatFullPanel.Instance.Close();

		if( target == null)
			return false;

		targetObject = target.gameObject;
		
		Clear();
	
		if( eNPCType.NPC == target.GetProperty<eNPCType>( eComponentProperty.NPC_TYPE))
		{
			m_NpcEntity = target as AsNpcEntity;
			m_NpcRec = AsTableManager.Instance.GetTbl_NormalNpc_Record( m_NpcEntity.TableIdx);
			
			//npc name
			Tbl_Npc_Record record = AsTableManager.Instance.GetTbl_Npc_Record( m_NpcEntity.TableIdx);
			npcName = m_NpcName.Text = record.NpcName;
			m_NpcTableID = m_NpcEntity.TableIdx;
		}
	
		if( null == m_NpcRec)
		{
			Debug.LogError( "null == m_NpcRec");
			return false;
		}
		
		if( m_NpcRec.FaceId != int.MaxValue)//none
		{
			int textNum = 1 + ( m_NpcRec.FaceId / ( m_TextureCount*m_TextureCount));

			string strImageFileName = "UI/Optimization/Texture/img_NPC_" + textNum;
			Texture2D npcImage = ResourceLoad.Loadtexture( strImageFileName) as Texture2D;
			Set_Tex( m_Npc_Image, npcImage, m_NpcRec.FaceId, m_TextureSize, m_TextureCount);
		}

		questHolder = QuestHolderManager.instance.GetQuestHolder( m_NpcTableID);
		
		//Pc Image Setting
		AsUserEntity entity = AsEntityManager.Instance.UserEntity;

		if( null != entity)
		{
			int faceImageId = 0;
			eCLASS __class = entity.GetProperty<eCLASS>( eComponentProperty.CLASS);
			eGENDER gender = entity.GetProperty<eGENDER>( eComponentProperty.GENDER);
			eRACE tribe = entity.GetProperty<eRACE>( eComponentProperty.RACE);
			Tbl_Class_Record record = AsTableManager.Instance.GetTbl_Class_Record( tribe, __class);

			switch( gender)
			{
			case eGENDER.eGENDER_MALE:
				faceImageId = record.Portrait_Male;
				break;
			case eGENDER.eGENDER_FEMALE:
				faceImageId = record.Portrait_Female;
				break;
			}	

			int textureNum = 1 + ( faceImageId / ( m_TextureCount*m_TextureCount));
			string strPcImageFileName = "UI/Optimization/Texture/img_PC_" + textureNum;
			Texture2D pcImage = ResourceLoad.Loadtexture( strPcImageFileName) as Texture2D;
			
			Set_Tex( m_Pc_Image, pcImage, faceImageId, m_TextureSize, m_TextureCount);
		}

		// for talk clear
		if( ( false == _callFromQuestClear) && ( true == CheckTalkComplete()))
			return true;
	
		gameObject.SetActiveRecursively( true);
		gameObject.active = true;
		
	
		if(0 !=  m_NpcRec.VoiceCount)
		{
			int VoiceIndex = UnityEngine.Random.Range( 0, m_NpcRec.VoiceCount);
			AsSoundManager.Instance.PlaySound( m_NpcRec.Voice(VoiceIndex), Vector3.zero, false);////npc Voice
		}
		
		int SpeechIndex = UnityEngine.Random.Range( 0, m_NpcRec.SpeechCount);
		SetTalk( m_NpcRec.Speech( SpeechIndex));////npc Speech
		
		if( m_NpcRec.FaceId == int.MaxValue)//none
			SetVisible( m_Npc_Image.gameObject, false);

		SetVisible( m_Pc_Image.gameObject, false);
		
		UpdateMenuButton();

		// check clear quest
		m_Questlist.FindQuestFromObject( m_NpcEntity.gameObject);

		ArkSphereQuestTool.QuestData questData = m_Questlist.GetClearQuest();
		
		if( questData != null)
	        AsHudDlgMgr.Instance.OpenQuestAcceptUI(questData, true);
		
		m_Questlist.Visible = false;
		
		AsHudDlgMgr.dlgPresentState |= AsHudDlgMgr.eDlgPresentState.NpcMenu;

		if (questHolder != null)
			QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.OPEN_NPC_TALK));
		//{
		//    QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.OPEN_NPC_TALK));

		//    if (questHolder.NowMarkType == QuestMarkType.HAVE_EVENT  || questHolder.nowQuetMarkType == QuestMarkType.HAVE_EVENT_AND_PROGRESS)
		//        if (m_NpcEntity != null)
		//            questHolder.UpdateQuestMark(m_NpcEntity.TableIdx);
		//}
		
		return true;
	}
示例#15
0
 public ObjStepping(int iGroupIndex, int iLinkIndex, AsNpcEntity npcEntity )
 {
     m_iGroupIndex = iGroupIndex;
     AddObjEntity(iLinkIndex, npcEntity);
 }
示例#16
0
	public void AddObjEntity( int iLinkIndex, AsNpcEntity asObjEntity )
	{
        if (null == asObjEntity)
		{
            Debug.LogError("null == asObjEntity");
			return;
		}
		
		if( 0 == m_ObjEntityList.Count )
		{		
			//Debug.Log("ttttnormal [ " + iLinkIndex + " , " + m_ObjEntityList.Count );
        	m_ObjEntityList.Add(asObjEntity);	
			
		}
		else
		{     		
			
			if( iLinkIndex > m_ObjEntityList[m_ObjEntityList.Count-1].GetProperty<int>(eComponentProperty.LINK_INDEX) )
			{
				//Debug.Log("normal [ " + iLinkIndex + " , " + m_ObjEntityList.Count );
				m_ObjEntityList.Add(asObjEntity);
			}
			else
			{
			
				//Debug.Log("iLinkIndex > m_ObjEntityList.Count [ " + iLinkIndex + " , " + m_ObjEntityList.Count );
				
				List<AsNpcEntity> tempList = m_ObjEntityList;
				m_ObjEntityList = new List<AsNpcEntity>();
				
				
				bool bAddSucc = false;
				foreach( AsNpcEntity temp in tempList )
				{
					if( iLinkIndex < temp.GetProperty<int>(eComponentProperty.LINK_INDEX) && bAddSucc == false )
					{
						m_ObjEntityList.Add(asObjEntity);
						bAddSucc = true;
					}
					m_ObjEntityList.Add(temp);				
				}	
			}
		}		
	}
示例#17
0
	public void IdleClickObject( AsNpcEntity npcObject, Vector3 vec3Target )
	{
		Vector3 vec3CharPos = AsEntityManager.Instance.UserEntity.transform.position;
		int iListEndIndex = m_ObjEntityList.Count-1;
		
		Collider coliderBegin = m_ObjEntityList[0].GetComponentInChildren<Collider>();
		Collider coliderEnd = m_ObjEntityList[iListEndIndex].GetComponentInChildren<Collider>();
		
		if( m_ObjEntityList[0] == npcObject || m_ObjEntityList[iListEndIndex] == npcObject ) 
		{
			AsEntityManager.Instance.BroadcastMessageToAllEntities(
	                	new Msg_Input_Move(vec3Target));
		}		
		else if( coliderBegin.bounds.Contains(vec3CharPos ) )
		{
			AsCommonSender.SendObjectJump(m_ObjEntityList[1].SessionId);			
		}
		else if( coliderEnd.bounds.Contains(vec3CharPos ) )
		{
			AsCommonSender.SendObjectJump(m_ObjEntityList[iListEndIndex-1].SessionId);		
			
		}
		else
		{
			float fFirstLengh = (m_ObjEntityList[0].transform.position - vec3CharPos).magnitude;
        	float fEndLengh = (m_ObjEntityList[iListEndIndex].transform.position - vec3CharPos).magnitude;
			
			AsNpcEntity RailNpcEntity = m_ObjEntityList[iListEndIndex];
	        if (fFirstLengh < fEndLengh)
	        {
	            RailNpcEntity = m_ObjEntityList[0];
	        }			
			
			AsEntityManager.Instance.BroadcastMessageToAllEntities(
	                	new Msg_Input_Move(RailNpcEntity.transform.position));
		}
		
		
		
	}	
示例#18
0
	public void NextClickObject( AsNpcEntity npcObject, Vector3 vec3Target )
	{
		AsCommonSender.SendObjectJump(npcObject.SessionId);
	}
示例#19
0
	public void ClickObject( AsNpcEntity npcObject, Vector3 vec3Target )
	{
		if (3 > m_ObjEntityList.Count)
        {
            Debug.LogError("3 > m_ObjEntityList.Count");
            return;
        }
		
		switch( GetSteppingState() )
		{
		case eSTEPPIG_STATE.IDLE:
			IdleClickObject( npcObject, vec3Target );
			break;
			
		case eSTEPPIG_STATE.JUMP_START:
			break;
			
		case eSTEPPIG_STATE.LANDING:			
			break;
			
		case eSTEPPIG_STATE.LEAF_IDLE:
			NextClickObject( npcObject, vec3Target );
			break;
		}
	}
示例#20
0
	public void UpdateByNpcEntity(AsNpcEntity _npcEntity)
	{
		QuestHolder questHolder = QuestHolderManager.instance.GetQuestHolder(_npcEntity.TableIdx);

		if (questHolder == null)
			return;

		List<Tbl_Event_Record> listEvent = AsTableManager.Instance.GetTbl_Event(_npcEntity.TableIdx, System.DateTime.Now.AddTicks(AsGameMain.serverTickGap));
		List<Tbl_Event_Record> listFiltered = new List<Tbl_Event_Record>();

		foreach (Tbl_Event_Record record in listFiltered)
		{
			if (record.viewList == true)
				continue;

			listFiltered.Add(record);
		}

		if (listFiltered.Count > 0)
		{
			if (questHolder.NowMarkType == QuestMarkType.NOTHING || questHolder.nowQuetMarkType == QuestMarkType.UPPERLEVEL || questHolder.nowQuetMarkType == QuestMarkType.PROGRESS)
			{
				if (questHolder.NowMarkType == QuestMarkType.PROGRESS)
				{
					questHolder.nowQuetMarkType = QuestMarkType.HAVE_EVENT_AND_PROGRESS;
					QuestHolder.SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT_AND_PROGRESS);
				}
				else
				{
					questHolder.nowQuetMarkType = QuestMarkType.HAVE_EVENT;
					QuestHolder.SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT);
				}
			}
		}
		else
		{
			if (questHolder.NowMarkType == QuestMarkType.HAVE_EVENT || questHolder.NowMarkType == QuestMarkType.HAVE_EVENT_AND_PROGRESS)
				questHolder.UpdateQuestMark(_npcEntity.TableIdx);
		}
	}
示例#21
0
	public void RegisterNpcCharacter( AsNpcEntity _entity)
	{
		m_dicNpcEntity_SessionId.Add( _entity.SessionId, _entity);
		m_dicEntity_InstanceId.Add( _entity.gameObject.GetInstanceID(), _entity);
	}
示例#22
0
    public void FindQuestFromObject(GameObject gameobject)
    {
        Init();

        questOwnObject = gameobject;

        npcEntity      = questOwnObject.GetComponentInChildren<AsNpcEntity>();

        if (UpdateQuestList() == true)
			QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.SHOW_QUESTLIST));
    }
示例#23
0
	public void RemovePet( AsNpcEntity _pet)
	{
		RequestDestroy( _pet);
	}
示例#24
0
	void OnPetDataIndicate( AsIMessage _msg)
	{
		Msg_PetDataIndicate indicate = _msg as Msg_PetDataIndicate;
		m_Pet = AsEntityManager.Instance.PetAppear( indicate.data_);
		m_Pet.HandleMessage( indicate);
		
		m_PetData = indicate;
		
		m_UserEntity.OwnPet( true);
		
		if( indicate.data_.initial_ == true)
			StartCoroutine( HatchPerform());
	}
示例#25
0
	/*public bool IsEndObject( int iGroupIndex, AsNpcEntity npcObject )
	{
	}*/
	
	public bool IsEndObject( ObjStepping objstepping, AsNpcEntity npcObject )
	{
        int iLinkIndex = npcObject.GetProperty<int>(eComponentProperty.LINK_INDEX);

        return objstepping.GetBegintLinkIndex() == iLinkIndex || objstepping.GetEndLinkIndex() == iLinkIndex;
	}
示例#26
0
	public Msg_Input_Attack( AsNpcEntity _enemy)
	{
		m_MessageType = eMessageType.INPUT_ATTACK;

		enemy_ = _enemy;
	}
示例#27
0
	public float GetNearestMonsterExceptObject( Vector3 _pos, out AsNpcEntity _npc)
	{
		_npc = null;
		float nearestDistance = float.MaxValue;

		foreach( KeyValuePair<int, AsNpcEntity> pair in m_dicNpcEntity_SessionId)
		{
			if( pair.Value.ContainProperty( eComponentProperty.LIVING) == true && pair.Value.GetProperty<bool>( eComponentProperty.LIVING) == true &&
				pair.Value.isSegregate == false)
			{
				if( pair.Value.CheckObjectMonster() == true)
					continue;

				float dist = Vector3.SqrMagnitude( pair.Value.transform.position - _pos);
				if( pair.Value.gameObject.layer == LayerMask.NameToLayer( "Monster") && dist < nearestDistance)
				{
					nearestDistance = dist;
					_npc = pair.Value;
				}
			}
		}

		return Mathf.Sqrt( nearestDistance);
	}