public override ActionResult Execute(Agent agent, float deltaTime) { if (geyser == null || geyser.Resources () <= 0) { ResourceManager rm = ResourceManager.GetInstance (agent.Avatar.layer); geyser = rm.NearestGeyser (agent.Avatar.transform.position); } return (geyser == null ? ActionResult.FAILURE : ActionResult.SUCCESS); }
public void Init(GeyserController geyserController, int id) { ObjectId = id; _geyserController = geyserController; geyserController.OnGeyserActivateEvent += () => HandleEvent(true); geyserController.OnGeyserDeactivateEvent += () => HandleEvent(false); }
public override ActionResult Start(Agent agent, float deltaTime) { geyser = null; if (actionContext.ContextItemExists ("targetGeyser")) { // early termination check Transform targetGeyser = actionContext.GetContextItem<Transform>("targetGeyser"); if (targetGeyser) { geyser = targetGeyser.GetComponent<GeyserController>(); } } return ActionResult.SUCCESS; }
IEnumerator DoLaserGeyser() { isAttacking = true; isControllingLaser = true; animator.SetTrigger("LASER_GEYSER"); yield return(new WaitForSeconds(comboJSON.getStartup("LASER_GEYSER") * (1f / 60f))); Vector3 geyserOffset; if (facingLeft) { geyserOffset = new Vector3(-3f, 0f, 0f); } else { geyserOffset = new Vector3(3f, 0f, 0f); } GameObject laser = ObjectPooler.Instance.SpawnFromPool(Pool.LASER_GEYSER, transform.position + geyserOffset, Quaternion.identity); GeyserController geyser = laser.GetComponent <GeyserController>(); geyser.PassPlayerObject(gameObject); geyser.OnObjectSpawn(); //Spawn stuff asofijaseofijaesofj while ((Input.GetButton("TriggerL") || Input.GetButton("TriggerR"))) { yield return(new WaitForSeconds(1f / 60f)); } geyser.playerInitiateExplode = true; //Explode laser if it hasnt been isControllingLaser = false; EndAttack(); }
public void RemoveGeyser(GeyserController geyser) { geysers.Remove (geyser); }
public bool LinkedGeyser(GeyserController geyser) { return geysers.Contains (geyser); }
public void AddGeyser(GeyserController geyser) { geysers.Add (geyser); }