public override void EnterState(CardHandController cardHand) { Debug.Log("Card Dragged State Entered"); cardHand.dragButton.image.color = Color.green; cardHand.selectButton.image.color = Color.yellow; }
public override void EnterState(CardHandController cardHand) { //throw new System.NotImplementedException(); Debug.Log("Card No Selected State Entered"); cardHand.idleButton.image.color = Color.green; cardHand.dropButton.image.color = Color.white; }
public override void EnterState(CardHandController cardHand) { Debug.Log("Card Selected State entered"); cardHand.selectButton.image.color = Color.green; cardHand.idleButton.image.color = Color.white; cardHand.dropButton.image.color = Color.white; cardHand.TransitionToState(cardHand.cardDragged); }
void IncrementPosition(CardHandController cardHand) { // Calculate the next position float delta = speed * Time.deltaTime; Vector3 currentPosition = cardHand.CardBeingDragged.transform.position; Vector3 nextPosition = Vector3.MoveTowards(currentPosition, destination, delta); // Move the object to the next position cardHand.CardBeingDragged.transform.position = nextPosition; //Debug.Log("Increment Position "+CardBeingDragged.transform.position.ToString()); }
public override void EnterState(CardHandController cardHand) { Debug.Log("Card Released State entered"); cardHand.dragButton.image.color = Color.white; cardHand.selectButton.image.color = Color.white; cardHand.dropButton.image.color = Color.yellow; mZcoord = Camera.main.WorldToScreenPoint(cardHand.CardBeingDragged.gameObject.transform.position).z; mOffset = cardHand.CardBeingDragged.transform.position - GetMNouseWorldPos(); SetDestination(GetMNouseWorldPos()); }
public override void Update(CardHandController cardHand) { if (destination != cardHand.CardBeingDragged.transform.position && destination != null) { // Move towards the destination each frame until the object reaches it IncrementPosition(cardHand); } else { cardHand.TransitionToState(cardHand.cardNotSelected); } }
public abstract void OnMouseDown(CardHandController cardHand);
public abstract void Update(CardHandController cardHand);
public abstract void EnterState(CardHandController cardHand);
// Start is called before the first frame update void Start() { chc = FindObjectOfType <CardHandController>(); }
public override void Update(CardHandController cardHand) { }
public override void OnMouseUp(CardHandController cardHand) { cardHand.TransitionToState(cardHand.cardReleased); }
public override void OnMouseDrag(CardHandController cardHand) { }
// Start is called before the first frame update void Start() { CardHandController = FindObjectOfType <CardHandController>(); CardHandController.CardToRemove += CardHandController_CardToRemove; }
public PlayerData(CardDealer d, CardHandController h, SelfHider hider) { CardDealer = d; CardHandController = h; SelfHider = hider; }
public override void Update(CardHandController cardHand) { //throw new System.NotImplementedException(); }
public override void OnMouseUp(CardHandController cardHandj) { }
public void SetCardHandController(CardHandController cardHandController) => _cardHandController = cardHandController;
// Start is called before the first frame update void Start() { UserReportingClientConfiguration config = new UserReportingClientConfiguration(500, 300, 60, 10); UnityUserReporting.Configure(config); rightHandAnchor = GameObject.Find("RightHandAnchor"); leftHandAnchor = GameObject.Find("LeftHandAnchor"); rightHandGrabber = rightHandAnchor.GetComponent <SimpleGrabber>(); var mainDeck = GameObject.Find("MainDeck"); deckController = mainDeck.GetComponent <DeckController>(); deckCollider = mainDeck.GetComponent <Collider>(); cardHandController = leftHandAnchor.GetComponent <CardHandController>(); Core.AsyncInitialize(appID.ToString()).OnComplete((Message <Oculus.Platform.Models.PlatformInitialize> init_message) => { if (init_message.IsError) { Debug.LogError("Failed to initialize - " + init_message); } else { Entitlements.IsUserEntitledToApplication().OnComplete((entitlemnets_message) => { if (entitlemnets_message.IsError) { Debug.LogError("Entitlements failed - " + entitlemnets_message); } else { Users.GetLoggedInUser().OnComplete((Message <Oculus.Platform.Models.User> logged_in_user_message) => { if (logged_in_user_message.IsError) { Debug.LogError("Could not retrieve logged in user - " + logged_in_user_message); } else { localUser = logged_in_user_message.GetUser(); UnityUserReporting.CurrentClient.LogEvent(UserReportEventLevel.Info, "User logged in"); UnityUserReporting.CurrentClient.AddDeviceMetadata("userID", localUser.ID.ToString()); UnityUserReporting.CurrentClient.AddDeviceMetadata("username", localUser.OculusID); localAvatar = Instantiate(localAvatarPrefab); localAvatar.CanOwnMicrophone = false; localAvatar.UseSDKPackets = true; localAvatar.RecordPackets = true; localAvatar.PacketRecorded += OnLocalAvatarPacketRecorded; localAvatar.oculusUserID = localUser.ID.ToString(); var trackingSpace = GameObject.Find("TrackingSpace"); localAvatar.transform.position = trackingSpace.transform.position; localAvatar.transform.rotation = trackingSpace.transform.rotation; localAvatar.transform.parent = trackingSpace.transform; Rooms.SetUpdateNotificationCallback(OnRoomUpdateCallback); Net.SetConnectionStateChangedCallback(OnConnectionStateChangedCallback); Net.SetPeerConnectRequestCallback(OnConnectRequestCallback); Net.SetPingResultNotificationCallback(OnPingResultCallback); Voip.SetVoipConnectRequestCallback(OnVoipConnectRequestCallback); Voip.SetVoipStateChangeCallback(OnVoipStateChangedCallback); // NOTE - Setting this before the platform is initialized does NOT WORK!! Voip.SetMicrophoneFilterCallback(MicrophoneFilterCallback); Rooms.Join(roomID, true).OnComplete(OnRoomUpdateCallback); #if PLATFORM_ANDROID if (!Permission.HasUserAuthorizedPermission(Permission.Microphone)) { Permission.RequestUserPermission(Permission.Microphone); } UnityUserReporting.CurrentClient.AddDeviceMetadata("Microphone Enabled", Permission.HasUserAuthorizedPermission(Permission.Microphone).ToString()); #endif } }); } }); } }); }