using System;
// future todos
// MAYBE MAKE GRABBABALE and throwable?
// idle tail wag and blink?
// MANUAL SYNCHRONIZATION
public class CatBehaviour
{
//////// SYNCED VARS ////////
// SYNCED NONE
public bool isAwake = false;
//public Vector3 actualPos;
//////// UNSYNCED VARS ////////
public bool alreadyUp = false;
// public Vector3 originalLocation;
public static void Main()
Console.WriteLine("Hello World");
}
private void Start()
// get udonbehaviour
//actualPos = transform.position;
// originalLocation = transform.position;
private void Update()
if(isAwake)
// ANIMATIONS
// ----- PSEUDOCODE -----
/*
if Velocity <= 0.1f:
-> sitting anim
else if Velocity > 0.1f:
-> walking anim
*/
/* if(Networking.LocalPlayer.isMaster)
// respawn if fallen
if(transform.position.y <= -100)
transform.position = originalLocation;
// syncing location
// maybe master only syncs location every x frames so that it is not too much... Also since update() calls each frame, master is the only one doing work that stays, location wise
actualPos = transform.position;
SET OWNER.
behaviour.RequestSerialization()
/* jellyfish move code except..
currently master is the only one whose opinion matters location wise.... maybe this should change? maybe not?
if(shortestDist > 1 meter):
jellyfish move code
else if(shortestDist <= 1 meter)
if not already sitting down:
play sit down anim and dont move
private void Interact()
if(!isAwake)
isAwake = true;
alreadyUp = true;
//SET OWNER.
//behaviour.RequestSerialization()
// wake up anim
else
// behaviour.SendCustomNetworkEvent("PetCat");
// SHOULD ONLY GET CALLED ON CAT WAKING UP (and joiners!)
private void OnDeserialization()
// can only get here once!
if((!alreadyUp) && isAwake)
// SYNC LOCATION WITH MASTER!!!!!!
//transform.position = actualPos;
public void PetCat()
// PET animation and sound and particle system hearts etc!!!!