Beispiel #1
0
 private void OnCampUpdate(GameEvent ge, EventParameter parameter)
 {
     CampObj camp = CoreEntry.gEntityMgr.GetCampByServerID(parameter.longParameter) as CampObj;
     if (null != camp)
     {
         camp.ChangeType((CampType)parameter.intParameter);
     }
 }
Beispiel #2
0
 private void OnCampLeave(GameEvent ge, EventParameter parameter)
 {
     CoreEntry.gEntityMgr.RemoveCampByServerID(parameter.longParameter);
     CampObj camp = CoreEntry.gEntityMgr.GetCampByServerID(parameter.longParameter) as CampObj;
     if (null != camp)
     {
         camp.RecycleObj();
     }
 }
Beispiel #3
0
 private void OnCampEnter(GameEvent ge, EventParameter parameter)
 {
     Vector3 position = CommonTools.ServerPosToClient(parameter.intParameter1, parameter.intParameter2);
     Vector3 scale = new Vector3(parameter.floatParameter, parameter.floatParameter, parameter.floatParameter);
     GameObject campGo = CoreEntry.gSceneLoader.LoadCamp(parameter.longParameter, position, scale);
     if (null != campGo)
     {
         CampObj camp = campGo.GetComponent<CampObj>();
         if (null != camp)
         {
             camp.EffectSize = scale;
             camp.ChangeType((CampType)parameter.intParameter);
         }
     }
 }
Beispiel #4
0
        public GameObject LoadCamp(long serverID, Vector3 pos, Vector3 scale)
        {
            GameObject obj = new GameObject("Camp");

            pos.y = CommonTools.GetTerrainHeight(new Vector2(pos.x, pos.z));
            obj.transform.parent     = CoreEntry.gObjPoolMgr.ObjectPoolRoot.transform;
            obj.transform.position   = pos;
            obj.transform.rotation   = Quaternion.identity;
            obj.transform.localScale = Vector3.one;

            CampObj camp = obj.AddComponent <CampObj>();

            camp.Init(0, 0, serverID);
            camp.EffectSize = scale;

            CoreEntry.gEntityMgr.AddCamp(camp);

            return(obj);
        }