Ejemplo n.º 1
0
 public void ShowBackgroundStoryPanel()
 {
     backgroundStoryPanel.gameObject.SetActive(true);
     Data.UnitsProto.Unit unitProto = controller.GetUnitProto(unitId);
     backgroundStoryPanel.descripe = unitProto.Description_Txt.Localize();
     backgroundStoryPanel.RefreshPanel();
 }
Ejemplo n.º 2
0
        public void SpawnProjecile(Vector3 direction, int projectileMetaId, float speedRate)
        {
            SetRotation(direction, true);

            ProjectileProto proto = null;

            if (unitProjectiles.ContainsKey(projectileMetaId))
            {
                proto = unitProjectiles[projectileMetaId];
            }
            else
            {
                proto = DataManager.GetInstance().projectileProtoData.Find(p => p.ID == projectileMetaId);
            }

            if (proto != null)
            {
                PlayAnimation(TRIGGER_ATTACK, speedRate);
                PlayEffect(proto.FireEffect_ResourceId, proto.fire_res_bindpoint, speedRate);
            }
            else
            {
                DebugUtils.Assert(false, string.Format(" Can't find projectile meta id {0} when solder spawn a projectile", projectileMetaId));
            }
        }
Ejemplo n.º 3
0
        private void InitializedData()
        {
            UnitProto proto = DataManager.GetInstance().unitsProtoData.Find(p => p.ProfessionType == (int)ProfessionType.TramcarType);

            metaId         = proto.ID;
            modelId        = proto.Model;
            iconId         = proto.Icon;
            modelRadius    = ConvertUtils.ToLogicInt(proto.ModelRadius);
            deploymentCost = proto.DeploymentCost;
            maxHp          = proto.Health;
            armor          = proto.Armor;
            magicResist    = proto.MagicResist;
            speedFactor    = ConvertUtils.ToLogicInt(proto.MoveSpeed);
            moveMode       = (PathType)proto.MoveMode;
            chaseArea      = 100;// defalut whole map
            attackArea     = ConvertUtils.ToLogicInt(proto.AttackRange);
            miningInterval = ConvertUtils.ToLogicInt(proto.AttackInterval);
            emberHarvest   = proto.EmberHarvest;
            attackRadius   = ConvertUtils.ToLogicInt(proto.AttackRadius);
            killReward     = proto.killReward;
            healthRegen    = proto.HealthRegen;

            hurtType = AttackPropertyType.None;
            hp       = maxHp;

            healthRegenInterval = GameConstants.HP_RECOVERY_INTERVAL_MILLISECOND;
        }
Ejemplo n.º 4
0
        private void InitializedData()
        {
            UnitProto proto = DataManager.GetInstance().unitsProtoData.Find(p => p.ProfessionType == (int)ProfessionType.DemolisherType);

            metaId         = proto.ID;
            modelId        = proto.Model;
            iconId         = proto.Icon;
            modelRadius    = ConvertUtils.ToLogicInt(proto.ModelRadius);
            deploymentCost = proto.DeploymentCost;
            maxHp          = proto.Health;
            armor          = proto.Armor;
            magicResist    = proto.MagicResist;
            speedFactor    = ConvertUtils.ToLogicInt(proto.MoveSpeed);
            moveMode       = (PathType)proto.MoveMode;
            chaseArea      = 100;// default all unit
            attackArea     = ConvertUtils.ToLogicInt(proto.AttackRange);
            attackInterval = ConvertUtils.ToLogicInt(proto.AttackInterval);
            damage         = (int)proto.PhysicalAttack;
            damageVar      = ConvertUtils.ToLogicInt(proto.MeleeDmgVar);
            attackRadius   = ConvertUtils.ToLogicInt(proto.AttackRadius);
            structAddition = ConvertUtils.ToLogicInt(proto.StrctDmgMult);
            killReward     = proto.killReward;
            healthRegen    = proto.HealthRegen;

            hurtType = AttackPropertyType.PhysicalAttack;
            hp       = maxHp;

            healthRegenInterval = GameConstants.HP_RECOVERY_INTERVAL_MILLISECOND;
        }
Ejemplo n.º 5
0
 private void SkillDescriptionButtonEvent()
 {
     unitAttackInfoPanel.gameObject.SetActive(true);
     Data.UnitsProto.Unit unitProto = controller.GetUnitProto(unitId);
     unitAttackInfoPanel.descripe = controller.GetUnitSkillDescribe(unitProto.SkillID2);
     unitAttackInfoPanel.icon     = unitProto.Icon;
     unitAttackInfoPanel.RefreshPanel();
 }
Ejemplo n.º 6
0
        public void ShowUnitBuyPanel()
        {
            unitBuyPanel.gameObject.SetActive(true);
            Data.UnitsProto.Unit unitProto = controller.GetUnitProto(unitId);
            unitBuyPanel.descripe          = unitProto.Description_Txt.Localize();
            unitBuyPanel.icon              = unitProto.Icon_bust;
            unitBuyPanel.unitName          = unitProto.Name;
            unitBuyPanel.playerGold        = controller.dataManager.GetPlayerGold();
            unitBuyPanel.playerCrystal     = controller.dataManager.GetPlayerEmber();
            unitBuyPanel.playerDiamond     = controller.dataManager.GetPlayerDiamond();
            unitBuyPanel.boughtNumber      = controller.GetUnitBoughtNumber(unitId);
            unitBuyPanel.boughtNumberLimit = controller.GetUnitBoughtNumberLimit(unitId);

            int[] prices = controller.GetUnitCost(unitId);
            unitBuyPanel.diamondCost = prices[0];
            unitBuyPanel.goldCost    = prices[1];
            //unitBuyPanel.crystalCost = prices[2];

            unitBuyPanel.RefreshPanel();
            unitBuyPanel.onClickEvent = OnUnitBuyClickCallBack;
        }
Ejemplo n.º 7
0
        public void Initialize(long id, UnitType type, ForceMark mark, UnitProto proto)
        {
            this.id          = id;
            this.soldierType = type;
            this.mark        = mark;
            this.proto       = proto;

            attackEffectResId      = proto.attack_res;
            attackEffectBindpoint  = proto.attack_res_bindpoint;
            attackHitResId         = proto.attack_hit_res;
            attackHitResBindpoint  = proto.attack_hit_res_bindpoint;
            critEffectResId        = proto.crit_effect_res;
            critEffectResBindpoint = proto.crit_effect_res_bindpoint;

            gameObject.name  = string.Format("SoldierRender{0}", id);
            gameObject.layer = LayerMask.NameToLayer(LayerName.LAYER_UNIT);

            Color32 color = render.material.GetColor("_RimColor");

            normalColor    = new Color32(100, 100, 100, 255);
            highlightColor = new Color32(0, 97, 255, 255);
            render.material.SetColor("_RimColor", color);
        }