Пример #1
0
    public override void EnterState(CardHandController cardHand)
    {
        Debug.Log("Card Dragged State Entered");

        cardHand.dragButton.image.color   = Color.green;
        cardHand.selectButton.image.color = Color.yellow;
    }
Пример #2
0
    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;
    }
Пример #3
0
    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);
    }
Пример #4
0
    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());
    }
Пример #5
0
    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());
    }
Пример #6
0
 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);
     }
 }
Пример #7
0
 public abstract void OnMouseDown(CardHandController cardHand);
Пример #8
0
 public abstract void Update(CardHandController cardHand);
Пример #9
0
 public abstract void EnterState(CardHandController cardHand);
Пример #10
0
 // Start is called before the first frame update
 void Start()
 {
     chc = FindObjectOfType <CardHandController>();
 }
Пример #11
0
 public override void Update(CardHandController cardHand)
 {
 }
Пример #12
0
 public override void OnMouseUp(CardHandController cardHand)
 {
     cardHand.TransitionToState(cardHand.cardReleased);
 }
Пример #13
0
 public override void OnMouseDrag(CardHandController cardHand)
 {
 }
Пример #14
0
 // Start is called before the first frame update
 void Start()
 {
     CardHandController = FindObjectOfType <CardHandController>();
     CardHandController.CardToRemove += CardHandController_CardToRemove;
 }
Пример #15
0
 public PlayerData(CardDealer d, CardHandController h, SelfHider hider)
 {
     CardDealer         = d;
     CardHandController = h;
     SelfHider          = hider;
 }
Пример #16
0
 public override void Update(CardHandController cardHand)
 {
     //throw new System.NotImplementedException();
 }
Пример #17
0
 public override void OnMouseUp(CardHandController cardHandj)
 {
 }
Пример #18
0
 public void SetCardHandController(CardHandController cardHandController) => _cardHandController = cardHandController;
Пример #19
0
    // 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
                            }
                        });
                    }
                });
            }
        });
    }