// 建立Soldier public override ISoldier CreateSoldier(ENUM_Soldier emSoldier, ENUM_Weapon emWeapon, int Lv, Vector3 SpawnPosition) { // 產生對應的Character ICharacter theSoldier = null; switch (emSoldier) { case ENUM_Soldier.Rookie: theSoldier = new SoldierRookie(); break; case ENUM_Soldier.Sergeant: theSoldier = new SoldierSergeant(); break; case ENUM_Soldier.Captain: theSoldier = new SoldierCaptain(); break; default: Debug.LogWarning("CreateSoldier:無法建立[" + emSoldier + "]"); return(null); } // 增加角色功能 AddCharacterFuncs(theSoldier, emWeapon, Lv); // 加入管理器 //PBaseDefenseGame.Instance.AddSoldier( theSoldier as ISoldier); return(theSoldier as ISoldier); }
void Start() { ICharacter character = new SoldierCaptain(); character.Weapon = new WeaponLaser(); character.Attack(Vector3.zero); }
// 訓練Caption單位 public ISoldier TrainCaption(ENUM_Weapon emWeapon, int Lv) { // 產生物件 SoldierCaptain theSoldier = new SoldierCaptain(); // 設定模型 GameObject tmpGameObject = CreateGameObject("CaptainGameObjectName"); tmpGameObject.gameObject.name = "SoldierCaptain"; theSoldier.SetGameObject(tmpGameObject); // 加入武器 IWeapon Weapon = CreateWeapon(emWeapon); theSoldier.SetWeapon(Weapon); // 取得Soldier的數值,設定給角色 SoldierAttr theSoldierAttr = CreateSoliderAttr(3); theSoldierAttr.SetSoldierLv(Lv); theSoldier.SetCharacterAttr(theSoldierAttr); // 加入AI SoldierAI theAI = CreateSoldierAI(); theSoldier.SetAI(theAI); // 加入管理器 //PBaseDefenseGame.Instance.AddSoldier( theSoldier as ISoldier ); return(theSoldier as ISoldier); }
// Use this for initialization void Start() { sceneController = new SceneStateController(); sceneController.SetState(new StartState(sceneController), false); ICharacter ch = new SoldierCaptain(); //ch.Weapon = new WeaponGun(); //ch.Attack(Vector3.zero); }
public ICharacter CreateCharacter(string characterName) { ISoldier soldier = null; string assetName = ""; switch (characterName) { case "Captain": assetName = "Captain"; break; case "Captive": assetName = "Captive"; break; case "Rookie": assetName = "Rookie"; break; case "Sergeant": assetName = "Sergeant"; break; } IAssetsFactory resoureLoadFactory = new ResouresLoadFactory(); GameObject GO = resoureLoadFactory.LoadSoldier(assetName); switch (characterName) { case "Captain": soldier = new SoldierCaptain(); break; case "Captive": soldier = new SoldierCaptive(); break; case "Rookie": soldier = new SoldierRookie(); break; case "Sergeant": soldier = new SoldierSergeant(); break; } return(soldier); }
// Start is called before the first frame update void Start() { //Sphere sphere = new Sphere(); //sphere.Draw(); //IRenderEngine mRenderEngine = new RenderX(); //IShape mSphere = new Cube(mRenderEngine); //mSphere.Draw(); ICharacter character = new SoldierCaptain(); //WeaponRifle rifle = new WeaponRifle(); //character.rifle = rifle; character.weapon = new WeaponGun(); // character.Attack(Vector3.zero); }
void Start() { //IRenderEngine renderEngine = new OpenGL(); //Sphere1 sphere1 = new Sphere1(renderEngine); // sphere1.Draw(); // // sphere1.DrawX(); //Cube1 cube1 = new Cube1(renderEngine); //cube1.Draw(); // //cube1.DrawX(); //Capsule1 capsule1 = new Capsule1(renderEngine); //capsule1.Draw(); // // capsule1.DrawX(); ICharacter character = new SoldierCaptain(); //WeaponRifle rifle = new WeaponRifle(); // character.Weapon = new WeaponRifle(); character.Attack(character); }
// Start is called before the first frame update void Start() { IRenderEngine renderEngine = new DirectX(); Sphere sphere = new Sphere(renderEngine); sphere.Draw(); //ICharacter character = new SoldierCaptain(); //WeaponRifle gun = new WeaponRifle(); //character.rifle = gun; //character.Attack(Vector3.one); ICharacter character = new SoldierCaptain(); character.weapon = new WeaponGun(); character.Attack(Vector3.one); }
private void Start() { //IRenderEngine renderEngine = new DirectX(); //Sphere sphere = new Sphere(renderEngine); //sphere.Draw(); //Cube cube = new Cube(renderEngine); //cube.Draw(); //Capsule capsule = new Capsule(renderEngine); //capsule.Draw(); ICharacter character = new SoldierCaptain(); //WeaponGun gun = new WeaponGun(); //character.gun = gun; //character.Attack(new Vector3(1, 1, 1)); //IWeapon rifle = new WeaponRocket(); //character.weapon = rifle; //character.Attack(new Vector3(1, 1, 1)); }
public virtual void VisitSoldierCaptain(SoldierCaptain Captain) { VisitSoldier(Captain); }
public virtual void VisitSoldierCaptain(SoldierCaptain Captain) { VisitSoldier( Captain ); }
public override void VisitSoldierCaptain(SoldierCaptain Captain) { base.VisitSoldierCaptain(Captain); SoldierCaptainCount++; }
public override void VisitSoldierCaptain (SoldierCaptain Captain) { base.VisitSoldierCaptain(Captain); SoldierCaptainCount++; }
// 訓練Caption單位 public ISoldier TrainCaption(ENUM_Weapon emWeapon,int Lv) { // 產生物件 SoldierCaptain theSoldier = new SoldierCaptain(); // 設定模型 GameObject tmpGameObject = CreateGameObject("CaptainGameObjectName"); tmpGameObject.gameObject.name = "SoldierCaptain"; theSoldier.SetGameObject( tmpGameObject ); // 加入武器 IWeapon Weapon = CreateWeapon(emWeapon); theSoldier.SetWeapon( Weapon ); // 取得Soldier的數值,設定給角色 SoldierAttr theSoldierAttr = CreateSoliderAttr(3); theSoldierAttr.SetSoldierLv(Lv); theSoldier.SetCharacterAttr(theSoldierAttr); // 加入AI SoldierAI theAI = CreateSoldierAI(); theSoldier.SetAI( theAI ); // 加入管理器 //PBaseDefenseGame.Instance.AddSoldier( theSoldier as ISoldier ); return theSoldier as ISoldier; }
// 建立Soldier public override ISoldier CreateSoldier( ENUM_Soldier emSoldier, ENUM_Weapon emWeapon, int Lv,Vector3 SpawnPosition) { // 產生對應的Character ICharacter theSoldier = null; switch( emSoldier) { case ENUM_Soldier.Rookie: theSoldier = new SoldierRookie(); break; case ENUM_Soldier.Sergeant: theSoldier = new SoldierSergeant(); break; case ENUM_Soldier.Captain: theSoldier = new SoldierCaptain(); break; default: Debug.LogWarning("CreateSoldier:無法建立[" + emSoldier + "]"); return null; } // 增加角色功能 AddCharacterFuncs( theSoldier, emWeapon, Lv); // 加入管理器 //PBaseDefenseGame.Instance.AddSoldier( theSoldier as ISoldier); return theSoldier as ISoldier; }