public override void OnCollisionExit(NPC_FSM NPC) { NPC.snakeSprite.color = new Color(1, 1, 1, 0); //Render snake sprite invisible NPC.bodyRender.enabled = true; //Reactivate gameobject mesh renderer NPC.wingSprite.gameObject.SetActive(true); //Reactivate wings to show them NPC.TransitionToState(NPC.idleState); //Change back to idle state when finished tranforming }
//Based on Jistyles. (2014) Coroutine without MonoBehaviour. [online] Unity Answers. Available at: https://answers.unity.com/questions/161084/coroutine-without-monobehaviour.html. [Accessed on: 10th May 2021]. private IEnumerator WaitForClip(NPC_FSM NPC, float timer) { Debug.Log("Started timing uncomfortable: " + Time.deltaTime); yield return(new WaitForSeconds(timer)); NPC.TransitionToState(NPC.idleState); Debug.Log("Ended timing uncomfortable: " + Time.deltaTime); }
public override void OnCollisionEnter(NPC_FSM NPC) { randomNumber = Random.Range(1, 10); //When collided with player avatar, a random number is polled which will then become the condition to execute one of following options: //Debug.Log("Random number is: " + randomNumber); //If the random number polled is 8 or higher, do this if (randomNumber > 7) { NPC.TransitionToState(NPC.kissingState); //Transition to kissing state //Debug.Log("Kissing time!"); } //If the random number is between 1 and 4, do this else if (randomNumber > 0 && randomNumber < 5) { NPC.TransitionToState(NPC.transformingState); //Transition to transforming state //Debug.Log("Transforming time!"); } else { NPC.TransitionToState(NPC.talkingState); //If draw a number without set condition, do nothing Debug.Log("Failed roll"); } }
public override void OnCollisionExit(NPC_FSM NPC) { NPC.TransitionToState(NPC.idleState); //Change back to idle state when finished kissing Debug.Log("Kiss ended"); }