public override bool check(Controller c) { HermitCrab hc = State.cast <HermitCrab> (c); if (hc.GetComponent <PushBlock> ()._beingPushed) { hc.setWasPushed(true); hc.resetSitDuration(); return(false); } else { return(hc.updateSitDuration(Time.deltaTime) && hc.getStands()); } }
public override void perform(Controller c) { HermitCrab hc = State.cast <HermitCrab> (c); source = c.GetComponent <AudioSource>(); if (source != null) { source.Stop(); source.loop = false; source.PlayOneShot(AudioLibrary.inst.hermitCrabDown, 1); Debug.Log("Sit Sound"); } hc.GetComponent <PushBlock> ().enableMovement(); hc.resetSitDuration(); }