Ejemplo n.º 1
0
 //===========================================================================================================
 //ボタン
 public void PushButton()
 {
     // 受付状態且つ表示状態ならボタンを押せる
     if (clothingbuyandwear.GetState() == ClothingBuyAndWear.STATE.RECEPTION &&
         clothing.GetState() == Clothing.SHELFSTATE.PREVIEW)
     {
         clothingbuyandwear.PushButton();
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        if (clothing.GetState() == Clothing.SHELFSTATE.PREVIEW &&
            buyandwearbutton.GetState() == ClothingBuyAndWear.STATE.RECEPTION && curtainanime.state == CurtainAnime.STATE.WAIT)
        {
            if (Input.GetMouseButton(0))
            {
                // 押された瞬間だった場合は旧座標を保存する
                if (!TouchFlag)
                {
                    OldTouchPos = Input.mousePosition;
                    TouchPos    = OldTouchPos;
                    TouchFlag   = true;
                }

                //移動量が一定値に達しているなら
                if (CheckDistance())
                {
                    Vector3 velocity = Input.mousePosition - OldTouchPos;

                    // 上下左右それぞれの移動倍率をかける
                    velocity = new Vector3(velocity.x * HorizontalRate, velocity.y * VerticalRate, velocity.z);
                    // 慣性移動用の値を保存
                    InertiaMove = velocity;

                    // オブジェクトを移動させる
                    MoveObject(velocity);
                }
                // 移動が終わったので旧座標を保存する
                OldTouchPos = Input.mousePosition;
            }
            else
            {
                TouchFlag = false;


                // 摩擦率をかける
                InertiaMove *= Friction;

                // スピードが遅くなったら完全停止させる
                if (Mathf.Abs(InertiaMove.x) <= StopThreshold && Mathf.Abs(InertiaMove.y) <= StopThreshold)
                {
                    InertiaMove = Vector3.zero;
                }

                // 摩擦計算込みの移動をする
                MoveObject(InertiaMove);
            }
        }
    }
Ejemplo n.º 3
0
 //状態関連
 //確認
 private void Check()
 {
     if (shop.IsFadeEnd())
     {
         if (!connect.IsWait())
         {
             //二つの状態が服開放になっているならイベントを実行
             if (clothing.GetState() == Clothing.SHELFSTATE.REWARDRELEASE &&
                 buyandwearbutton.GetState() == ClothingBuyAndWear.STATE.REWARDRELEASE)
             {
                 State = REWARDRELEASE.CLOTHING_MOVE;
             }
         }
     }
 }
Ejemplo n.º 4
0
    //ヒント表示
    private void PreviewHint()
    {
        // 通信中または下記状態なら不可
        if (clothing.GetState() != Clothing.SHELFSTATE.PREVIEW ||
            GetState() != ClothingBuyAndWear.STATE.RECEPTION ||
            curtainAnime.state != CurtainAnime.STATE.WAIT ||
            previewparent.State != PreviewParent.STATE.WAIT
            )
        {
            return;
        }

        //取得完了
        if (!connect.IsWait() && playfabstore.isCatalogGet && storeachivement.isStoreGet && playfabstore.isStoreGet)
        {
            //選択されている服のカスタムデータがある
            if (selectclothing.GetItemInfo().catalogItem.CustomData != null)
            {
                //実績達成アイテムを所持しているか
                var achievementItem = storeachivement.StoreItems.Find(x => x.ItemId == selectclothing.GetItemInfo().catalogItem.CustomData.ToString());
                //条件達成服を持っておらず、実績を達成していなければ、ヒントを表示
                if (!inventory.IsHaveItem(selectclothing.GetItemInfo().catalogItem.ItemId) && !reachachievement.IsReachAchievement(achievementItem.ItemId.ToString()))
                {
                    IsPreviewHint = true;
                }
                else
                {
                    IsPreviewHint = false;
                }
            }
            else
            {
                IsPreviewHint = false;
            }
        }
    }