Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        public void Init(GeyserController geyserController, int id)
        {
            ObjectId          = id;
            _geyserController = geyserController;

            geyserController.OnGeyserActivateEvent   += () => HandleEvent(true);
            geyserController.OnGeyserDeactivateEvent += () => HandleEvent(false);
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
    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();
    }
Ejemplo n.º 5
0
 public void RemoveGeyser(GeyserController geyser)
 {
     geysers.Remove (geyser);
 }
Ejemplo n.º 6
0
 public bool LinkedGeyser(GeyserController geyser)
 {
     return geysers.Contains (geyser);
 }
Ejemplo n.º 7
0
 public void AddGeyser(GeyserController geyser)
 {
     geysers.Add (geyser);
 }