private void Awake() { instance = this; CurState = WarriorState.Move; m_image = GetComponent <Image>(); }
void Start() { playerReference = FindObjectOfType <WarriorController>(); m_rigidbody = GetComponent <Rigidbody2D>(); m_spriteRenderer = GetComponent <SpriteRenderer>(); m_originalGravity = m_rigidbody.gravityScale; }
public WarriorController GetWarriorControllerByIndex(int index) { WarriorController c = null; WarriorControllerDic.TryGetValue(index, out c); return(c); }
public PlayerController GetLocalPlayer() { GameObject player1 = GameObject.Find("Verde"); GameObject player2 = GameObject.Find("Rojo"); GameObject player3 = GameObject.Find("Amarillo"); if (player1) { MageController player1Controller = player1.GetComponent <MageController>(); if (player1Controller.localPlayer) { return(player1Controller); } } if (player2) { WarriorController player2Controller = player2.GetComponent <WarriorController>(); if (player2Controller.localPlayer) { return(player2Controller); } } if (player3) { EngineerController player3Controller = player3.GetComponent <EngineerController>(); if (player3Controller.localPlayer) { return(player3Controller); } } return(null); }
public WarriorController GetWarrior() { GameObject player = GameObject.Find("Rojo"); WarriorController script = player.GetComponent <WarriorController>(); return(script); }
public PlayerController GetLocalPlayer() { GameObject player1 = GameObject.Find("Mage"); GameObject player2 = GameObject.Find("Warrior"); GameObject player3 = GameObject.Find("Engineer"); if (player1 != null) { MageController player1Controller = player1.GetComponent <MageController>(); if (player1Controller.localPlayer) { return(player1Controller); } } if (player2 != null) { WarriorController player2Controller = player2.GetComponent <WarriorController>(); if (player2Controller.localPlayer) { return(player2Controller); } } if (player3 != null) { EngineerController player3Controller = player3.GetComponent <EngineerController>(); if (player3Controller.localPlayer) { return(player3Controller); } } return(null); }
private EnemyController CreateController() { EnemyController controller; switch (this.enemyType) { case EnemyType.Mine: controller = new MineController(this); break; case EnemyType.Drone: controller = new DroneController(this); break; case EnemyType.MineLayer: controller = new MineLayerController(this); break; case EnemyType.Warrior: controller = new WarriorController(this); break; case EnemyType.Warlord: controller = new WarriorController(this); break; default: controller = new MineController(this); break; } return(controller); }
private void OnCollisionExit2D(Collision2D collision) { WarriorController warriorController = collision.collider.GetComponent <WarriorController>(); if (warriorController) { warrior = null; } }
void OnButtonPress() { Debug.Log("jump button pressed!"); playerControl = Game.instance.thePlayer.GetComponent<WarriorController>();; Debug.Log(playerControl.gameObject); Debug.Log(playerControl.isAcceptInput()); if (playerControl.isAcceptInput()) { playerControl.StartJump(); } }
//MeshRenderer rend; void Start() { controller = GetComponent <WarriorController>(); triggers = GetComponent <WarriorTriggers>(); player = player = GameObject.Find("Player"); playerController = player.GetComponent <PlayerController>(); //rend = transform.GetChild(0).GetComponent<MeshRenderer>(); controller.state = State.standing; }
// Use this for initialization void Awake() { nivel = 1; generadorText = GetComponent <GeneradorTextHit>(); jugador = GetComponent <WarriorController>(); salud = GetComponent <Salud>(); expSiguienteNivel = CurvaExperiencia(nivel); ActualizarBarraDeExp(); LlamarBotonesAtributos(); }
public WarriorController GetWarrior() { if (players == null) { return(null); } GameObject player = players[1]; WarriorController script = player.GetComponent <WarriorController>(); return(script); }
public void OnClick() { List <Warrior> warriorList = BattleLogicPVE.m_BattleUnitManagerPVE.WarriorList; Warrior warrior = warriorList [m_Index]; if (!warrior.m_HasCastSuperSkill) { WarriorController controller = BattleLogicPVE.m_BattleUnitManagerPVE.GetWarriorControllerByIndex(m_Index); if (controller != null) { controller.CastSuperSkill(); } } }
void OnTriggerEnter(Collider _other) { if (_other.tag == "player_movement") { Debug.Log("###111### player collide with platform."); player = _other.transform.root.GetComponent<WarriorController>(); //if (_other.transform.position.y > transform.position.y) { if (player.FSM_Control.FsmVariables.GetFsmBool("isAffectedByGravity").Value == true) { Debug.Log("###222### player collide from above."); player.currentPlatform = this; player.transform.position = new Vector3(player.transform.position.x, stayHeight, player.transform.position.z); player.OnPlatformUpdate(); } } }
public void WarrioControllIndecDI() { //Arrange var mockConfig = new Mock <IConfiguration>(); Startup su = new Startup(mockConfig.Object); IServiceCollection serviceCollection; serviceCollection = new ServiceCollection(); su.ConfigureServices(serviceCollection); ServiceProvider spTester; spTester = serviceCollection.BuildServiceProvider(); //Act var controller = new WarriorController(spTester.GetService <IWarrior>()); var result = (ViewResult)controller.Index(); //Assert Assert.AreEqual(typeof(Samurai), result.Model.GetType()); }
private void HandlePlayerIdCoordination(string[] msg) { if (NotInClientScene()) { int incomingId = Int32.Parse(msg[1]); Debug.LogError("Incoming ID is: " + incomingId); switch (incomingId) { case 0: { LevelManager lManager = GameObject.FindObjectOfType <LevelManager>(); MageController mage = lManager.GetMage(); mage.playerId = incomingId; Debug.LogError("Now Mage has the ID: " + incomingId); } break; case 1: { LevelManager lManager = GameObject.FindObjectOfType <LevelManager>(); WarriorController warrior = lManager.GetWarrior(); warrior.playerId = incomingId; Debug.LogError("Now Warrior has the ID: " + incomingId); } break; case 2: { LevelManager lManager = GameObject.FindObjectOfType <LevelManager>(); EngineerController engin = lManager.GetEngineer(); engin.playerId = incomingId; Debug.LogError("Now Engineer has the ID: " + incomingId); } break; default: return; } } }
public void WarriorsControllerIndex() { // Arrange var mockConfig = new Mock <IConfiguration>(); //Mock the website config Startup su = new Startup(mockConfig.Object); //Get a web startup object IServiceCollection serviceCollection; serviceCollection = new ServiceCollection(); su.ConfigureServices(serviceCollection); //run the Startup Configure Services ServiceProvider _serviceProviderTester; //get a _service provider to test _serviceProviderTester = serviceCollection.BuildServiceProvider(); var controller = new WarriorController(_serviceProviderTester.GetService <IWarrior>()); // Act var result = (ViewResult)controller.Index(); // Assert Assert.AreEqual(typeof(ViewResult), result.GetType()); Assert.AreEqual("Warrior Home", result.ViewName); }
/// <summary> /// 创建神将; /// </summary> /// <returns></returns> public WarriorController CreateWarrior(int index, Vector3 pos, float orient, BattleTypes battleType) { Warrior warrior = m_WarriorList [index]; Quaternion rotate = Quaternion.Euler(new Vector3(0, orient * Mathf.Rad2Deg, 0)); GameObject prefab = ResourcesManager.Instance.LoadUnitObject(warrior.Model, UNIT_TYPE.WARRIOR); GameObject warriorObj = GameObject.Instantiate(prefab) as GameObject; warriorObj.transform.position = pos; warriorObj.transform.rotation = rotate; UnityEngine.AI.NavMeshAgent agent = warriorObj.AddComponent <UnityEngine.AI.NavMeshAgent>(); agent.speed = 0; agent.acceleration = 0; agent.angularSpeed = 0; //agent.avoidancePriority = (int)NavmeshPriority.WARRIOR; agent.height = warrior.Height; agent.radius = warrior.Radius; agent.stoppingDistance = 0.5f; //agent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance; CharacterController collider = warriorObj.AddComponent <CharacterController>(); collider.height = warrior.Height; collider.radius = warrior.Radius; collider.center = Vector3.up * (Mathf.Max(collider.height / 2.0f, collider.radius) + 0.03f); warriorObj.SetLayerRecursively(LayerMask.NameToLayer("Warrior")); WarriorController controller = warriorObj.AddComponent <WarriorController>(); m_WarriorControllerDic.Add(index, controller); controller.CurCombatUnit = warrior; //controller.m_BattleType = battleType; return(controller); }
private void ProcessUserInput() { if (!EventSystem.current.IsPointerOverGameObject()) { var offsetVector = new Vector3(0, 0, 1); if (Input.GetMouseButtonDown(0) && !brushMode)//select flag { #region Select flag var worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); var coll = Physics2D.OverlapCircle(worldPoint, 0.5f, LayerMask.GetMask("PlayerFlags")); if (coll) { if (currentlySelectedPlayer != null) { currentlySelectedPlayer.GetComponent <SpriteRenderer>().color = Color.white; } currentlySelectedPlayer = coll.GetComponent <PlayerController>(); currentlySelectedPlayer.GetComponent <SpriteRenderer>().color = Color.green; } else { if (currentlySelectedPlayer != null) { currentlySelectedPlayer.GetComponent <SpriteRenderer>().color = Color.white; } currentlySelectedPlayer = null; } #endregion Select flag #region Select warrior worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); coll = Physics2D.OverlapCircle(worldPoint, 0.5f, LayerMask.GetMask(HelperConstants.warriorTag)); if (coll) { currentlySelectedWarr = coll.GetComponent <WarriorController>(); selectedWarrStPanel.DrawGenome(simInst.coEvaluator.playerNetsDict[(PlayerController)currentlySelectedWarr.PlayerOwner][currentlySelectedWarr.ai.network]); } else { currentlySelectedWarr = null; } #endregion Select warrior } if (isEditorMode) { #region Not brush mode things if (!brushMode) { if (Input.GetMouseButton(0) && currentlySelectedPlayer != null)//set position { var worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); currentlySelectedPlayer.transform.position = (Vector2)worldPoint; currentlySelectedPlayer.pointsToVisitDuringTraining.Clear(); currentlySelectedPlayer.defaultPos = (worldPoint); } if (Input.GetMouseButtonDown(1) && currentlySelectedPlayer != null) { var worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); currentlySelectedPlayer.pointsToVisitDuringTraining.Add(new Vector3(worldPoint.x, worldPoint.y) - offsetVector); } if (Input.GetMouseButtonDown(2) && currentlySelectedPlayer != null)//reset points { currentlySelectedPlayer.pointsToVisitDuringTraining.Clear(); } } #endregion Not brush mode things #region Brush mode things else { #region Paint if (Input.GetMouseButton(0)) { var worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); var colls = Physics2D.OverlapCircleAll(worldPoint, HelperConstants.brushSize, LayerMask.GetMask(HelperConstants.tileTag)); foreach (var item in colls) { simInst.CreateNewBlock(item.transform.position, false); Destroy(item.gameObject); } } #endregion Paint #region Erase if (Input.GetMouseButton(1)) { var worldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); var colls = Physics2D.OverlapCircleAll(worldPoint, HelperConstants.brushSize, LayerMask.GetMask(HelperConstants.obstacleTag)); foreach (var item in colls) { simInst.CreateNewBlock(item.transform.position, true); Destroy(item.gameObject); } } #endregion Erase } #endregion Brush mode things } } }
private void Start() { micolisionador = GetComponent <BoxCollider2D>(); player = GameManager.instancia.jugador.GetComponent <WarriorController>(); }
void Awake() { controller = transform.root.GetComponent<WarriorController>(); }
// Update is called once per frame void Update() { /* * all of this should be handled differently when a player chooses a character. this is just for testing purposes */ if (lcm.plr1Set && player1 != null) { player1Health.maxValue = player1.maxHealth; player1Health.value = player1.currentHealth; if (player1.GetComponent <WarriorController>() != null) { WarriorController warrior = player1.GetComponent <WarriorController>(); player1Resource.maxValue = warrior.maxRage; player1Resource.value = warrior.currentRage; if (warrior.cleaveCooldown > Time.time) { player1ability1.color = new Color(1, 1, 1, 0.25f); } else { player1ability1.color = new Color(1, 1, 1, 1); } if (warrior.tauntCooldown > Time.time) { player1ability2.color = new Color(1, 1, 1, 0.25f); } else { player1ability2.color = new Color(1, 1, 1, 1); } if (warrior.shieldBashCooldown > Time.time) { player1ability3.color = new Color(1, 1, 1, 0.25f); } else { player1ability3.color = new Color(1, 1, 1, 1); } if (warrior.berserkerCooldown > Time.time) { player1ability4.color = new Color(1, 1, 1, 0.25f); } else { player1ability4.color = new Color(1, 1, 1, 1); } } else if (player1.GetComponent <SharpShooterController>() != null) { SharpShooterController sharpshooter = player1.GetComponent <SharpShooterController>(); player1Resource.maxValue = sharpshooter.maxEnergy; player1Resource.value = sharpshooter.currentEnergy; if (sharpshooter.multiShotCooldown > Time.time) { player1ability1.color = new Color(1, 1, 1, 0.25f); } else { player1ability1.color = new Color(1, 1, 1, 1); } if (sharpshooter.mineCooldown > Time.time) { player1ability2.color = new Color(1, 1, 1, 0.25f); } else { player1ability2.color = new Color(1, 1, 1, 1); } if (sharpshooter.invisibleCooldown > Time.time) { player1ability3.color = new Color(1, 1, 1, 0.25f); } else { player1ability3.color = new Color(1, 1, 1, 1); } if (sharpshooter.ultimateCooldown > Time.time) { player1ability4.color = new Color(1, 1, 1, 0.25f); } else { player1ability4.color = new Color(1, 1, 1, 1); } } else if (player1.GetComponent <MedicPlayerController>() != null) { MedicPlayerController medic = player1.GetComponent <MedicPlayerController>(); player1Resource.maxValue = medic.maxEnergy; player1Resource.value = medic.currentEnergy; if (medic.dogHealTime > Time.time) { player1ability1.color = new Color(1, 1, 1, 0.25f); } else { player1ability1.color = new Color(1, 1, 1, 1); } if (medic.grenadeTime > Time.time) { player1ability2.color = new Color(1, 1, 1, 0.25f); } else { player1ability2.color = new Color(1, 1, 1, 1); } if (medic.jumpTime > Time.time) { player1ability3.color = new Color(1, 1, 1, 0.25f); } else { player1ability3.color = new Color(1, 1, 1, 1); } if (medic.ultimateTime > Time.time) { player1ability4.color = new Color(1, 1, 1, 0.25f); } else { player1ability4.color = new Color(1, 1, 1, 1); } } else { MageController mage = player1.GetComponent <MageController>(); player1Resource.maxValue = mage.maxEnergy; player1Resource.value = mage.currentEnergy; if (mage.randomAttackCooldown > Time.time) { player1ability1.color = new Color(1, 1, 1, 0.25f); } else { player1ability1.color = new Color(1, 1, 1, 1); } if (mage.gravityCooldown > Time.time) { player1ability2.color = new Color(1, 1, 1, 0.25f); } else { player1ability2.color = new Color(1, 1, 1, 1); } if (mage.phaseCooldown > Time.time) { player1ability3.color = new Color(1, 1, 1, 0.25f); } else { player1ability3.color = new Color(1, 1, 1, 1); } if (mage.meteorCooldown > Time.time) { player1ability4.color = new Color(1, 1, 1, 0.25f); } else { player1ability4.color = new Color(1, 1, 1, 1); } } } if (lcm.plr2Set && player2 != null) { player2Health.maxValue = player2.maxHealth; player2Health.value = player2.currentHealth; if (player2.GetComponent <WarriorController>() != null) { WarriorController warrior = player2.GetComponent <WarriorController>(); player2Resource.maxValue = warrior.maxRage; player2Resource.value = warrior.currentRage; if (warrior.cleaveCooldown > Time.time) { player2ability1.color = new Color(1, 1, 1, 0.25f); } else { player2ability1.color = new Color(1, 1, 1, 1); } if (warrior.tauntCooldown > Time.time) { player2ability2.color = new Color(1, 1, 1, 0.25f); } else { player2ability2.color = new Color(1, 1, 1, 1); } if (warrior.shieldBashCooldown > Time.time) { player2ability3.color = new Color(1, 1, 1, 0.25f); } else { player2ability3.color = new Color(1, 1, 1, 1); } if (warrior.berserkerCooldown > Time.time) { player2ability4.color = new Color(1, 1, 1, 0.25f); } else { player2ability4.color = new Color(1, 1, 1, 1); } } else if (player2.GetComponent <SharpShooterController>() != null) { SharpShooterController sharpshooter = player2.GetComponent <SharpShooterController>(); player2Resource.maxValue = sharpshooter.maxEnergy; player2Resource.value = sharpshooter.currentEnergy; if (sharpshooter.multiShotCooldown > Time.time) { player2ability1.color = new Color(1, 1, 1, 0.25f); } else { player2ability1.color = new Color(1, 1, 1, 1); } if (sharpshooter.mineCooldown > Time.time) { player2ability2.color = new Color(1, 1, 1, 0.25f); } else { player2ability2.color = new Color(1, 1, 1, 1); } if (sharpshooter.invisibleCooldown > Time.time) { player2ability3.color = new Color(1, 1, 1, 0.25f); } else { player2ability3.color = new Color(1, 1, 1, 1); } if (sharpshooter.ultimateCooldown > Time.time) { player2ability4.color = new Color(1, 1, 1, 0.25f); } else { player2ability4.color = new Color(1, 1, 1, 1); } } else if (player2.GetComponent <MedicPlayerController>() != null) { MedicPlayerController medic = player2.GetComponent <MedicPlayerController>(); player2Resource.maxValue = medic.maxEnergy; player2Resource.value = medic.currentEnergy; if (medic.dogHealTime > Time.time) { player2ability1.color = new Color(1, 1, 1, 0.25f); } else { player2ability1.color = new Color(1, 1, 1, 1); } if (medic.grenadeTime > Time.time) { player2ability2.color = new Color(1, 1, 1, 0.25f); } else { player2ability2.color = new Color(1, 1, 1, 1); } if (medic.jumpTime > Time.time) { player2ability3.color = new Color(1, 1, 1, 0.25f); } else { player2ability3.color = new Color(1, 1, 1, 1); } if (medic.ultimateTime > Time.time) { player2ability4.color = new Color(1, 1, 1, 0.25f); } else { player2ability4.color = new Color(1, 1, 1, 1); } } else { MageController mage = player2.GetComponent <MageController>(); player2Resource.maxValue = mage.maxEnergy; player2Resource.value = mage.currentEnergy; if (mage.randomAttackCooldown > Time.time) { player2ability1.color = new Color(1, 1, 1, 0.25f); } else { player2ability1.color = new Color(1, 1, 1, 1); } if (mage.gravityCooldown > Time.time) { player2ability2.color = new Color(1, 1, 1, 0.25f); } else { player2ability2.color = new Color(1, 1, 1, 1); } if (mage.phaseCooldown > Time.time) { player2ability3.color = new Color(1, 1, 1, 0.25f); } else { player2ability3.color = new Color(1, 1, 1, 1); } if (mage.meteorCooldown > Time.time) { player2ability4.color = new Color(1, 1, 1, 0.25f); } else { player2ability4.color = new Color(1, 1, 1, 1); } } } if (lcm.plr3Set && player3 != null) { player3Health.maxValue = player3.maxHealth; player3Health.value = player3.currentHealth; if (player3.GetComponent <WarriorController>() != null) { WarriorController warrior = player3.GetComponent <WarriorController>(); player3Resource.maxValue = warrior.maxRage; player3Resource.value = warrior.currentRage; if (warrior.cleaveCooldown > Time.time) { player3ability1.color = new Color(1, 1, 1, 0.25f); } else { player3ability1.color = new Color(1, 1, 1, 1); } if (warrior.tauntCooldown > Time.time) { player3ability2.color = new Color(1, 1, 1, 0.25f); } else { player3ability2.color = new Color(1, 1, 1, 1); } if (warrior.shieldBashCooldown > Time.time) { player3ability3.color = new Color(1, 1, 1, 0.25f); } else { player3ability3.color = new Color(1, 1, 1, 1); } if (warrior.berserkerCooldown > Time.time) { player3ability4.color = new Color(1, 1, 1, 0.25f); } else { player3ability4.color = new Color(1, 1, 1, 1); } } else if (player3.GetComponent <SharpShooterController>() != null) { SharpShooterController sharpshooter = player3.GetComponent <SharpShooterController>(); player3Resource.maxValue = sharpshooter.maxEnergy; player3Resource.value = sharpshooter.currentEnergy; if (sharpshooter.multiShotCooldown > Time.time) { player3ability1.color = new Color(1, 1, 1, 0.25f); } else { player3ability1.color = new Color(1, 1, 1, 1); } if (sharpshooter.mineCooldown > Time.time) { player3ability2.color = new Color(1, 1, 1, 0.25f); } else { player3ability2.color = new Color(1, 1, 1, 1); } if (sharpshooter.invisibleCooldown > Time.time) { player3ability3.color = new Color(1, 1, 1, 0.25f); } else { player3ability3.color = new Color(1, 1, 1, 1); } if (sharpshooter.ultimateCooldown > Time.time) { player3ability4.color = new Color(1, 1, 1, 0.25f); } else { player3ability4.color = new Color(1, 1, 1, 1); } } else if (player3.GetComponent <MedicPlayerController>() != null) { MedicPlayerController medic = player3.GetComponent <MedicPlayerController>(); player3Resource.maxValue = medic.maxEnergy; player3Resource.value = medic.currentEnergy; if (medic.dogHealTime > Time.time) { player3ability1.color = new Color(1, 1, 1, 0.25f); } else { player3ability1.color = new Color(1, 1, 1, 1); } if (medic.grenadeTime > Time.time) { player3ability2.color = new Color(1, 1, 1, 0.25f); } else { player3ability2.color = new Color(1, 1, 1, 1); } if (medic.jumpTime > Time.time) { player3ability3.color = new Color(1, 1, 1, 0.25f); } else { player3ability3.color = new Color(1, 1, 1, 1); } if (medic.ultimateTime > Time.time) { player3ability4.color = new Color(1, 1, 1, 0.25f); } else { player3ability4.color = new Color(1, 1, 1, 1); } } else { MageController mage = player3.GetComponent <MageController>(); player3Resource.maxValue = mage.maxEnergy; player3Resource.value = mage.currentEnergy; if (mage.randomAttackCooldown > Time.time) { player3ability1.color = new Color(1, 1, 1, 0.25f); } else { player3ability1.color = new Color(1, 1, 1, 1); } if (mage.gravityCooldown > Time.time) { player3ability2.color = new Color(1, 1, 1, 0.25f); } else { player3ability2.color = new Color(1, 1, 1, 1); } if (mage.phaseCooldown > Time.time) { player3ability3.color = new Color(1, 1, 1, 0.25f); } else { player3ability3.color = new Color(1, 1, 1, 1); } if (mage.meteorCooldown > Time.time) { player3ability4.color = new Color(1, 1, 1, 0.25f); } else { player3ability4.color = new Color(1, 1, 1, 1); } } } if (lcm.plr4Set && player4 != null) { player4Health.maxValue = player4.maxHealth; player4Health.value = player4.currentHealth; if (player4.GetComponent <WarriorController>() != null) { WarriorController warrior = player4.GetComponent <WarriorController>(); player4Resource.maxValue = warrior.maxRage; player4Resource.value = warrior.currentRage; if (warrior.cleaveCooldown > Time.time) { player4ability1.color = new Color(1, 1, 1, 0.25f); } else { player4ability1.color = new Color(1, 1, 1, 1); } if (warrior.tauntCooldown > Time.time) { player4ability2.color = new Color(1, 1, 1, 0.25f); } else { player4ability2.color = new Color(1, 1, 1, 1); } if (warrior.shieldBashCooldown > Time.time) { player4ability3.color = new Color(1, 1, 1, 0.25f); } else { player4ability3.color = new Color(1, 1, 1, 1); } if (warrior.berserkerCooldown > Time.time) { player4ability4.color = new Color(1, 1, 1, 0.25f); } else { player4ability4.color = new Color(1, 1, 1, 1); } } else if (player4.GetComponent <SharpShooterController>() != null) { SharpShooterController sharpshooter = player4.GetComponent <SharpShooterController>(); player4Resource.maxValue = sharpshooter.maxEnergy; player4Resource.value = sharpshooter.currentEnergy; if (sharpshooter.multiShotCooldown > Time.time) { player4ability1.color = new Color(1, 1, 1, 0.25f); } else { player4ability1.color = new Color(1, 1, 1, 1); } if (sharpshooter.mineCooldown > Time.time) { player4ability2.color = new Color(1, 1, 1, 0.25f); } else { player4ability2.color = new Color(1, 1, 1, 1); } if (sharpshooter.invisibleCooldown > Time.time) { player4ability3.color = new Color(1, 1, 1, 0.25f); } else { player4ability3.color = new Color(1, 1, 1, 1); } if (sharpshooter.ultimateCooldown > Time.time) { player4ability4.color = new Color(1, 1, 1, 0.25f); } else { player4ability4.color = new Color(1, 1, 1, 1); } } else if (player4.GetComponent <MedicPlayerController>() != null) { MedicPlayerController medic = player4.GetComponent <MedicPlayerController>(); player4Resource.maxValue = medic.maxEnergy; player4Resource.value = medic.currentEnergy; if (medic.dogHealTime > Time.time) { player4ability1.color = new Color(1, 1, 1, 0.25f); } else { player4ability1.color = new Color(1, 1, 1, 1); } if (medic.grenadeTime > Time.time) { player4ability2.color = new Color(1, 1, 1, 0.25f); } else { player4ability2.color = new Color(1, 1, 1, 1); } if (medic.jumpTime > Time.time) { player4ability3.color = new Color(1, 1, 1, 0.25f); } else { player4ability3.color = new Color(1, 1, 1, 1); } if (medic.ultimateTime > Time.time) { player4ability4.color = new Color(1, 1, 1, 0.25f); } else { player4ability4.color = new Color(1, 1, 1, 1); } } else { MageController mage = player4.GetComponent <MageController>(); player4Resource.maxValue = mage.maxEnergy; player4Resource.value = mage.currentEnergy; if (mage.randomAttackCooldown > Time.time) { player4ability1.color = new Color(1, 1, 1, 0.25f); } else { player4ability1.color = new Color(1, 1, 1, 1); } if (mage.gravityCooldown > Time.time) { player4ability2.color = new Color(1, 1, 1, 0.25f); } else { player4ability2.color = new Color(1, 1, 1, 1); } if (mage.phaseCooldown > Time.time) { player4ability3.color = new Color(1, 1, 1, 0.25f); } else { player4ability3.color = new Color(1, 1, 1, 1); } if (mage.meteorCooldown > Time.time) { player4ability4.color = new Color(1, 1, 1, 0.25f); } else { player4ability4.color = new Color(1, 1, 1, 1); } } } }
// Start is called before the first frame update void Start() { m_warrior = WarriorController.instance; isFirstTime = true; }
public ProjectileController CreateNewProjectile(Vector2 start, Vector2 direction, float damage, WarriorController shooter) { var newObj = Instantiate(projectilePref, projectilesParent.transform); var scrpt = newObj.GetComponent <ProjectileController>(); scrpt.Initialize(start, direction, damage, shooter); return(scrpt); }
// Use this for initialization void Start() { knockDist = 3f; warrior_controller = gameObject.GetComponentInParent <WarriorController>(); }
void Awake() { playerController = transform.GetComponent<WarriorController>(); charBuild = transform.GetComponent<CharacterBuild>(); animation["walk"].speed = playerController.moveSpeed/120.0f; }