Beispiel #1
0
        /// <summary>
        /// 生成奖励.
        /// </summary>
        /// <param name="zone"></param>
        /// <param name="obj"></param>
        /// <param name="attacker"></param>
        /// <returns></returns>
        protected virtual RoleBattleAwardNotify GetRoleBattleAward(InstanceZone zone, InstanceUnit obj, InstancePlayer attacker)
        {
            RoleBattleAwardNotify ret = new RoleBattleAwardNotify();

            ret.MonsterID = obj.Info.ID;
            ret.RoleID    = attacker.PlayerUUID;
            return(ret);
        }
 private void CreateInstances()
 {
     GameObject[] instances = GameObject.FindGameObjectsWithTag("Instance");
     foreach (GameObject obj in instances)
     {
         InstanceZone zonecomp = obj.GetComponent <InstanceZone>();
         zonecomp.PrebakeNavMesh();
     }
 }
Beispiel #3
0
 protected virtual void Z_OnGameOver(InstanceZone zone, DeepCore.GameData.Zone.GameOverEvent evt)
 {
     zoneGameOver = true;
     //log.Info("ZoneNode GameOver : " + evt.message + " " + this.ZoneUUID);
     //notify logic.
     NotifyAllLogicsGameOver(evt);
     //notify areamanager close zone.
     service.area_manager.Invoke(new AreaZoneGameOverNotify()
     {
         zoneUUID = this.ZoneUUID,
         reason   = evt.message,
     });
 }
Beispiel #4
0
        //--------------------------------------------------------------------------------------------------------------------------------


        protected virtual void Z_OnUnitDead(InstanceZone zone, InstanceUnit obj, InstanceUnit attacker)
        {
            if (attacker != null && obj != null)
            {
                if (obj.Info.UType == DeepCore.GameData.Zone.UnitInfo.UnitType.TYPE_MONSTER && attacker is InstancePlayer)
                {
                    //玩家.
                    var player = attacker as InstancePlayer;
                    //生成奖励信息.
                    var notify = GetRoleBattleAward(zone, obj, player);
                    if (notify != null)
                    {
                        //通知游戏服.
                        NotifyLogicRoleAward(player.PlayerUUID, notify);
                    }
                }
            }
        }
Beispiel #5
0
 //交给子类去实现
 protected virtual void Z_OnUnitGotInstanceItem(InstanceZone zone, InstanceUnit unit, InstanceItem item)
 {
     //TODO
 }