144 lines
4.5 KiB
C#
144 lines
4.5 KiB
C#
|
|
/********************************************************************************
|
|||
|
|
* 文件名: Obj_Fellow.cs
|
|||
|
|
* 全路径: \Script\Obj\Obj_Fellow.cs
|
|||
|
|
* 创建人: 李嘉
|
|||
|
|
* 创建时间:2013-10-25
|
|||
|
|
*
|
|||
|
|
* 功能说明:帮会跑商马车Obj逻辑类
|
|||
|
|
* 修改记录:
|
|||
|
|
*********************************************************************************/
|
|||
|
|
|
|||
|
|
using GCGame;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using UnityEngine.UI;
|
|||
|
|
using System.Collections;
|
|||
|
|
using Games.GlobeDefine;
|
|||
|
|
using Games.Scene;
|
|||
|
|
using GCGame.Table;
|
|||
|
|
using Games.AnimationModule;
|
|||
|
|
using System;
|
|||
|
|
using Module.Log;
|
|||
|
|
|
|||
|
|
namespace Games.LogicObj
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
public class Obj_Init_Gharry : Obj_Character_Init_Data
|
|||
|
|
{
|
|||
|
|
public int sceneId;
|
|||
|
|
public int sceneInst;
|
|||
|
|
public int state; //0正常 1被绊
|
|||
|
|
public int m_CharModelID;
|
|||
|
|
|
|||
|
|
public Obj_Init_Gharry()
|
|||
|
|
{
|
|||
|
|
CleanUp();
|
|||
|
|
}
|
|||
|
|
public override void CleanUp()
|
|||
|
|
{
|
|||
|
|
base.CleanUp();
|
|||
|
|
sceneId = -1;
|
|||
|
|
sceneInst = -1;
|
|||
|
|
state = -1;
|
|||
|
|
m_CharModelID = -1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public class Obj_GuildGharry : Obj_Character
|
|||
|
|
{
|
|||
|
|
private ulong m_OwnerGuid;
|
|||
|
|
private string m_OwerName;
|
|||
|
|
private string m_Name;
|
|||
|
|
private Obj_OtherPlayer m_Ower = null;
|
|||
|
|
private int m_currState = -1;
|
|||
|
|
public override UIPathData HeadUiPath
|
|||
|
|
{
|
|||
|
|
get { return Obj_GuildGharryHeadUI.pathData; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public Obj_GuildGharry()
|
|||
|
|
{
|
|||
|
|
m_ObjType = GameDefine_Globe.OBJ_TYPE.OBJ_GHARRY;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override bool Init(ObjParent_Init_Data initData1)
|
|||
|
|
{
|
|||
|
|
bool result = base.Init(initData1);
|
|||
|
|
if (result == false)
|
|||
|
|
return result;
|
|||
|
|
Obj_Init_Gharry initData = initData1 as Obj_Init_Gharry;
|
|||
|
|
m_Ower = Singleton<ObjManager>.Instance.FindOtherPlayerByGuid(initData.m_OwerGuid);
|
|||
|
|
//服务器发过来的信息
|
|||
|
|
m_OwerName = initData.m_OwerName;
|
|||
|
|
m_Name = initData.m_StrName;
|
|||
|
|
m_OwnerGuid = initData.m_OwerGuid;
|
|||
|
|
if (GameManager.gameManager != null && m_OwnerGuid == GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid)
|
|||
|
|
{
|
|||
|
|
GameManager.gameManager.PlayerDataPool.nGharryObjID = initData.m_ServerID;
|
|||
|
|
}
|
|||
|
|
m_currState = initData.state;
|
|||
|
|
StateChange(m_currState);
|
|||
|
|
Tab_CharModel charModel = TableManager.GetCharModelByID(initData.m_CharModelID, 0);
|
|||
|
|
if (null != charModel)
|
|||
|
|
{
|
|||
|
|
BaseAttr.HeadPic = charModel.HeadPic;
|
|||
|
|
m_DeltaHeight = charModel.HeadInfoHeight * ModelScale;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
m_ObjTransform.localRotation = Utils.DirServerToClient(initData.m_fDir);
|
|||
|
|
|
|||
|
|
InitNavAgent();
|
|||
|
|
CreateNameBoard();
|
|||
|
|
LogModule.DebugLog(string.Format("Obj_GuildGharry Init {0} {1}", m_OwnerGuid, initData.state));
|
|||
|
|
InitImpactInfo(initData);
|
|||
|
|
ObjManager.Instance.AddPoolObj(this);
|
|||
|
|
CreateModel(ModelID);
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected override void CreateModelOver(Hashtable hashParam)
|
|||
|
|
{
|
|||
|
|
base.CreateModelOver(hashParam);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void InitNameBoard(Obj_HeadUI headUiItem)
|
|||
|
|
{
|
|||
|
|
base.InitNameBoard(headUiItem);
|
|||
|
|
HeadUi.Init(this);
|
|||
|
|
HeadUi.SetName(m_Name);
|
|||
|
|
HeadUi.SetOwnerName(m_OwerName);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void OwerNameChange(string owerName)
|
|||
|
|
{
|
|||
|
|
m_OwerName = owerName;
|
|||
|
|
if (HeadUi!=null)
|
|||
|
|
HeadUi.SetOwnerName(m_OwerName);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void FreshRoadSign()
|
|||
|
|
{
|
|||
|
|
if (GameManager.gameManager.AutoSearch != null)
|
|||
|
|
GameManager.gameManager.AutoSearch.RoadSignManager.RoadStateChange(new Vector3(Position.x,GameManager.gameManager.RunningScene,Position.z));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void StateChange(int state)
|
|||
|
|
{
|
|||
|
|
m_currState = state;
|
|||
|
|
if (m_OwnerGuid != GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid)
|
|||
|
|
return;
|
|||
|
|
if (m_currState == 1)
|
|||
|
|
{
|
|||
|
|
UIManager.ShowUI(UIInfo.GuildHarryItem, null, null);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
UIManager.CloseUI(UIInfo.GuildHarryItem);
|
|||
|
|
}
|
|||
|
|
FreshRoadSign();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void DestroyObj()
|
|||
|
|
{
|
|||
|
|
base.DestroyObj();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|