public virtual void Initialize() { if( mThisWave < 10 ) mUnitType = EUnitType.Basic; mMaxX = mTile; mMaxY = mTile; }
private void SetMethodUnit(EUnitType unitType, int unitTo) { switch (unitType) { case EUnitType.AirFlow: method.AirFlow = (EUnitAirFlow)unitTo; break; case EUnitType.Capacity: case EUnitType.EER_COP: method.CoolingCapacity = (EUnitCapacity)unitTo; break; case EUnitType.Enthalpy: case EUnitType.Heat: method.Enthalpy = (EUnitEnthalpy)unitTo; break; case EUnitType.Temperature: method.Temperature = (EUnitTemperature)unitTo; break; case EUnitType.Pressure: method.Pressure = (EUnitPressure)unitTo; break; case EUnitType.DiffPressure: method.DiffPressure = (EUnitDiffPressure)unitTo; break; case EUnitType.AtmPressure: method.AtmPressure = (EUnitAtmPressure)unitTo; break; } }
public void SpawnObject(int index) { if (this.PrefabsToInstantiate != null && index < this.PrefabsToInstantiate.Count) { MyType = (EUnitType)index; EnemyType = MyType == EUnitType.FirstPlayer ? EUnitType.SecondPlayer : EUnitType.FirstPlayer; var prefab = this.PrefabsToInstantiate[index]; if (prefab == null) { return; } #if UNITY_EDITOR Debug.Log("Auto-Instantiating: " + prefab.name); #endif Vector3 spawnPos; Quaternion spawnRot; GetSpawnPoint(index, out spawnPos, out spawnRot); PhotonNetwork.Instantiate(EventHandler.name, spawnPos, spawnRot); var newobj = PhotonNetwork.Instantiate(prefab.name, spawnPos, spawnRot, 0); SpawnedObjects.Push(newobj); } }
private void AddUnitAvailable(EUnitType type, int qty = 1) { int unit = GetUnitAvailable(type); unit += qty; SetUnitAvailable(type, unit); }
public void SetUnitTo(EUnitType type, int unit) { Lock(); try { foreach (KeyValuePair <string, ValueRow> row in Const) { if (row.Value.Unit.Type == type) { row.Value.Unit.To = unit; } } foreach (KeyValuePair <string, ValueRow> row in Calcurated) { if (row.Value.Unit.Type == type) { row.Value.Unit.To = unit; } } foreach (KeyValuePair <string, ValueRow> row in Measured) { if (row.Value.Unit.Type == type) { row.Value.Unit.To = unit; } } } finally { Unlock(); } }
private void SetLevel(EUnitType type, int lvl) { switch (type) { case EUnitType.Archer: _archerLVL = lvl; _archerHP = _archerBaseHP * _archerLVL; _archerDMG = _archerBaseDMG * _archerLVL; _recruitBowCost = _recruitBaseBowCost * _archerLVL; _upgradeBowCost = _upgradeBaseBowCost * _archerLVL; break; case EUnitType.Swordsman: _swordsmanLVL = lvl; _swordsmanHP = _swordsmanBaseHP * _swordsmanLVL; _swordsmanDMG = _swordsmanBaseDMG * _swordsmanLVL; _recruitSwordCost = _recruitBaseSwordCost * _swordsmanLVL; _upgradeSwordCost = _upgradeBaseSwordCost * _swordsmanLVL; break; case EUnitType.Spearman: _spearmanLVL = lvl; _spearmanHP = _spearmanBaseHP * _spearmanLVL; _spearmanDMG = _spearmanBaseDMG * _spearmanLVL; _recruitSpearCost = _recruitBaseSpearCost * _spearmanLVL; _upgradeSpearCost = _upgradeBaseSpearCost * _spearmanLVL; break; } }
private double GetRatio(EUnitType type, int from, int to) { double ratio = 0; switch (type) { case EUnitType.AirFlow: ratio = GetAirFlowRatio((EUnitAirFlow)from, (EUnitAirFlow)to); break; case EUnitType.Capacity: case EUnitType.Enthalpy: case EUnitType.Heat: case EUnitType.EER_COP: ratio = GetCapacityRatio((EUnitCapacity)from, (EUnitCapacity)to); break; case EUnitType.Pressure: ratio = GetPressureRatio((EUnitPressure)from, (EUnitPressure)to); break; case EUnitType.AtmPressure: ratio = GetAtmPressureRatio((EUnitAtmPressure)from, (EUnitAtmPressure)to); break; case EUnitType.DiffPressure: ratio = GetDiffPressureRatio((EUnitDiffPressure)from, (EUnitDiffPressure)to); break; } return(ratio); }
public UnitConvert(EUnitType type, int from, int to, bool enabled = true) { Type = type; From = from; To = to; Enabled = enabled; }
private void SetPlotSeriesUnit(int index, EUnitType unitType, int unitTo) { foreach (TabPage page in graphTab.TabPages) { (page.Controls[0] as CtrlViewGraphPanel) .SetPlotSeriesUnit(index, unitType, unitTo); } }
public static double ConvertDegreeTo(double rate, EUnitType futureUnit) { return(futureUnit switch { EUnitType.Kilometer => (rate * DegreeOnKilometers), EUnitType.Meter => (rate * DegreeOnMeters), _ => - 1 });
private void Shot(int damage, EUnitType unitType, Vector3 position, Quaternion rotation, Vector3 dir, float speed) { photonView = PhotonView.Get(this); var gameObject = PoolSystem.Pop(); gameObject.SetActive(true); ref var newBulletComponent = ref gameObject.GetComponent <BulletProvider>().GetData(out _);
public static InvoiceItem Create( string name, decimal unitPrice, EUnitType unitType, decimal discount, double quantity ) { return(new InvoiceItem(null, name, unitPrice, unitType, discount, quantity)); }
public virtual void Initialize() { if (mThisWave < 10) { mUnitType = EUnitType.Basic; } mMaxX = mTile; mMaxY = mTile; }
public UnitWave( EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval ) { mThisWave = DefenderWorld.Instance.Status.Wave; mSpawningPoint = spawn; mTile = tileSize; mUnitType = unitType; mToCreate = numUnits; mInterval = interval; Initialize(); }
public UnitWave(EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval) { mThisWave = DefenderWorld.Instance.Status.Wave; mSpawningPoint = spawn; mTile = tileSize; mUnitType = unitType; mToCreate = numUnits; mInterval = interval; Initialize(); }
public bool IsType(ushort x, ushort y, EUnitType unitType) { var vo = GetUnitVO(x, y); if (null == vo || vo.type != unitType) { return(false); } return(true); }
public override IUnit CreateUnit(EUnitType unitType) { switch (unitType) { case EUnitType.Distroyer: return(new CDistroyer()); default: throw new Exception("指定了错误的海中单位类型"); } }
public override IUnit CreateUnit(EUnitType unitType) { switch (unitType) { case EUnitType.Soldier: return(new CSoldier()); default: throw new Exception("指定了错误的陆地单位类型"); } }
public void CreateUnit(EUnitType type, EUnitColor color, Tile tile) { switch (type) { case EUnitType.Infantry: units.Add(new Infantry(color, tile)); break; default: break; } }
public static Unit CreateUnit(string res, EUnitType unitType) { GameObject unitGo = Object.Instantiate(Resources.Load(res)) as GameObject; Unit unit = unitGo.GetComponent <Unit>(); if (unit == null) { unit = unitGo.AddComponent <Unit>(); } unit.ID = IdGenerater.GenerateId(); unit.UnitType = unitType; return(unit); }
protected virtual int BuildWave() { int spawn = mSpawnRand.Next(Spawns.Count); UnitType++; if ((int)UnitType >= (int)EUnitType.MAX) { UnitType = EUnitType.Basic; } mWaves.Add(new UnitWave(UnitType, Spawns[spawn], SpawnSize, TileSize, mUnitInterval)); return(spawn); }
public void ChangeAnimationByUnitType(EUnitType Type) { switch (Type) { case EUnitType.Treasure: this.MarkType = UnitGaugeMark.EMarkType.MapChest; break; case EUnitType.Gem: this.MarkType = UnitGaugeMark.EMarkType.MapGem; break; } }
public void SetEndByUnitType(EUnitType Type) { switch (Type) { case EUnitType.Treasure: this.SetEndAnimation(UnitGaugeMark.EMarkType.MapChest); break; case EUnitType.Gem: this.SetEndAnimation(UnitGaugeMark.EMarkType.MapGem); break; } }
public void Init(int unitID, int level, EUnitType unitType = EUnitType.EUT_Monster, ACT.EUnitCamp unitCamp = ACT.EUnitCamp.EUC_ENEMY, bool aiEnable = false, int aiDiff = 0) { base.Init(unitID, level, unitType, unitCamp); mAIEnable = aiEnable; AIDiff = aiDiff; if (mAIEnable) { ActStatus.Bind(new ACT.AIListener(this, this)); } }
public ValueRow( int index, string name, float value, string format, UnitConvert unit, bool save = false, bool chart = false, EUnitType yAxis = EUnitType.None) { Index = index; Name = name; Value = value; Format = format; Unit = unit; State = EValueState.None; YAxis = yAxis; Chart = chart; Save = save; Storage = (Save == true) ? new ValueStorage(csLength) : null; }
public InvoiceItem( IObjectIdentifier <ulong> id, string name, decimal unitPrice, EUnitType unitType, decimal discount, double quantity ) { Id = id; Name = name; UnitPrice = unitPrice; UnitType = unitType; Discount = discount; Quantity = quantity; }
private InvoiceItemDto( IObjectIdentifier <ulong> id, string name, decimal unitPrice, EUnitType unitType, decimal discount, double quantity ) { _id = id; _name = name; _unitPrice = unitPrice; _unitType = unitType; _discount = discount; _quantity = quantity; }
public void TestUnit(EFaction factions, EUnitType unitType, int number) { GameObject go = new GameObject(); CSpriteRenderer sp = new CSpriteRenderer(SpriteContainer.Instance.Pixel); CAnimator animator = new CAnimator(); CUnit unit = new CUnit(ETeam.Team01, unitType, factions); CMove move = new CMove(); go.AddComponent <CUnit>(unit); go.AddComponent <CMove>(move); go.AddComponent <CSpriteRenderer>(sp); go.AddComponent <CAnimator>(animator); go.Transform.Position -= new Microsoft.Xna.Framework.Vector2(650 - 150 * number, 0); Instantiate(go); }
ObjectPoolBase GetPoolByType(EUnitType unitType) { ObjectPoolBase tmpObjPool = null; switch (unitType) { case EUnitType.EUT_LocalPlayer: tmpObjPool = Game.PoolMgr.GetObjectPool <HudInfoPlayer>() as ObjectPoolBase; break; default: tmpObjPool = Game.PoolMgr.GetObjectPool <HudInfoMonster>() as ObjectPoolBase; break; } return(tmpObjPool); }
private int GetUnitAvailable(EUnitType type) { switch (type) { case EUnitType.Archer: return(_iArchersAvalaible); case EUnitType.Swordsman: return(_iSwordsAvalaible); case EUnitType.Spearman: return(_iSpearsAvalaible); default: return(0); } }
public UnitCacheInfo(EUnitType type, uint obj_idx) { UnitID = new UnitID(); UnitID.type = (byte)type; UnitID.obj_idx = obj_idx; if (type == EUnitType.UNITTYPE_PLAYER) { AOIPlayer = new UnitEnterAOI._Player(); } else if (type == EUnitType.UNITTYPE_MONSTER) { AOIMonster = new UnitEnterAOI._Monster(); } else if (type == EUnitType.UNITTYPE_PET) { AOIPet = new UnitEnterAOI._Pet(); } }
private void AddLevel(EUnitType type) { switch (type) { case EUnitType.Archer: _archerLVL++; SetLevel(EUnitType.Archer, _archerLVL); break; case EUnitType.Swordsman: _swordsmanLVL++; SetLevel(EUnitType.Swordsman, _swordsmanLVL); break; case EUnitType.Spearman: _spearmanLVL++; SetLevel(EUnitType.Spearman, _spearmanLVL); break; } }
protected virtual int BuildWave() { int spawn = mSpawnRand.Next(Spawns.Count); UnitType++; if ((int)UnitType >= (int)EUnitType.MAX) UnitType = EUnitType.Basic; mWaves.Add(new UnitWave(UnitType, Spawns[spawn], SpawnSize, TileSize, mUnitInterval)); return spawn; }
public UnitTypeWave( EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval ) : base( unitType, spawn, numUnits, tileSize, interval ) { }
public EReturnCode TrainUnit(EUnitType _unitType, int _amount) { throw new NotImplementedException(); }