private void Start() { myRigidBody2d = this.gameObject.GetComponent <Rigidbody2D>(); carrier = null; isInteractable = true; originalPosition = this.gameObject.transform.position; originalWorld = currentWorld; EventManager.instance.blockOutOfBounds.AddListener(ResetBlock); }
public void MoveToWorld(DataTypes.World world, Transform go) { if (world == DataTypes.World.WorldOne) { go.parent = worldOneRoot; } else { go.parent = worldTwoRoot; } }
private void ResetBlock(GameObject blockOOB) { if (blockOOB == this.gameObject) { carrier = null; isInteractable = true; transform.position = originalPosition; myRigidBody2d.isKinematic = false; currentWorld = originalWorld; WorldManager.instance.MoveToWorld(currentWorld, transform); } }
public Vector3 GetPlayerLocation(DataTypes.World world) { if (world == DataTypes.World.WorldOne) { Debug.Log("Looking at player: " + myPlayerOneInfo.playerNumber + " at position: " + myPlayerOneInfo.transform.position); return(myPlayerOneInfo.transform.position); } else { Debug.Log("Looking at player: " + myPlayerTwoInfo.playerNumber + " at position: " + myPlayerTwoInfo.transform.position); return(myPlayerTwoInfo.transform.position); } }
public bool Teleport(DataTypes.World newWorld, float newWorldY) { if (isInteractable) { currentWorld = newWorld; transform.position = new Vector3(transform.position.x, newWorldY, transform.position.z); WorldManager.instance.MoveToWorld(newWorld, transform); return(true); } return(false); }