protected override void RPC_S2C_Turn(uLink.BitStream stream, uLink.NetworkMessageInfo info) { transform.rotation = stream.Read <Quaternion>(); //if (null != _viewTrans) // _viewTrans.rotation = transform.rotation; CSBuildingLogic csbl = Runner.GetComponent <CSBuildingLogic>(); if (csbl != null) { DragItemAgent dia = DragItemAgent.GetById(csbl.id); dia.rotation = transform.rotation; } if (null != Runner) { CSEntityObject ceo = Runner.GetComponentInChildren <CSEntityObject>(); if (ceo != null) { if (csbl != null) { ceo.Init(csbl, ceo.m_Creator, false); } } DragItemMousePickColony itemscript = Runner.GetComponentInChildren <DragItemMousePickColony>(); if (itemscript != null) { itemscript.OnItemOpGUIHide(); } } }
public override void Turn90Degree() { base.Turn90Degree(); if (!GameConfig.IsMultiMode) { CSEntityObject ceo = GetComponent <CSEntityObject>(); if (ceo != null) { csbl = GetComponentInParent <CSBuildingLogic>(); if (csbl != null) { ceo.Init(csbl, ceo.m_Creator, false); csbl.m_Entity.AfterTurn90Degree(); } //else{ // ceo.Init(itemObjectId, ceo.m_Creator, false); // } } } OnItemOpGUIHide(); }
public override void OnConstruct() { base.OnConstruct(); csbl = GetComponentInParent <CSBuildingLogic>(); if (!GameConfig.IsMultiMode) { CSMgCreator creator = CSMain.s_MgCreator; if (creator != null) { CSEntityObject ceo = GetComponent <CSEntityObject>(); int r; if (csbl != null) { r = ceo.Init(csbl, creator); } else { r = ceo.Init(itemObjectId, creator); } if (r != CSConst.rrtSucceed) { Debug.LogError("Error with Init Entities"); } else { if (ceo.m_Type == CSConst.ObjectType.Assembly) { CSMain.SinglePlayerCheckClod(); //--to do: attack //ColonyRunner cr = gameObject.GetComponent<ColonyRunner>(); //if (cr != null) //{ // cr.DeathHandlerEvent += OnTowerDeath; //} } // SendMessage("OnPutGo", mItemObj.instanceId); } } // SendMessage("OnCreatedGo", mItemObj.instanceId); } else { int buildingTeam; if (csbl != null) { buildingTeam = csbl.TeamId; } else { buildingTeam = mNetlayer.TeamId; } ; CSMgCreator creator; if (buildingTeam == BaseNetwork.MainPlayer.TeamId) { creator = CSMain.s_MgCreator; } else { creator = CSMain.Instance.MultiGetOtherCreator(buildingTeam) as CSMgCreator; } if (creator != null) { CSEntityObject ceo = GetComponent <CSEntityObject>(); ColonyNetwork colonyNetwork = mNetlayer as ColonyNetwork; ceo._ColonyObj = colonyNetwork._ColonyObj; int r; if (csbl != null) { r = ceo.Init(csbl, creator); } else { r = ceo.Init(itemObjectId, creator); } if (r != CSConst.rrtSucceed) { Debug.LogError("Error with Init Entities"); // Debug.Break(); } else { if (ceo.m_Type == CSConst.ObjectType.Assembly) { CSMain.SinglePlayerCheckClod(); //--to do: attack //ColonyRunner cr = gameObject.GetComponent<ColonyRunner>(); //if (cr != null) //{ // cr.DeathHandlerEvent += OnTowerDeath; //} } //SendMessage("OnPutGo", mItemObj.instanceId); } } //SendMessage("OnCreatedGo", itemObj.instanceId); } }