public override int evaluate()
    {
        int correct = 0;

        int i = 0;

        foreach (Transform child in answersPanelRightUsed.transform.GetChild(0))
        {
            DragSlot   answerSlot = child.gameObject.GetComponent <DragSlot> ();
            GameObject answer     = answerSlot.item;
            answer.GetComponent <DragHandler> ().enabled = false;
            if (answer.GetComponentInChildren <Text> ().text == correctOrder [i])
            {
                setImageColor(answer.GetComponent <Image> (), "#8CE5B9FF");
                correct++;
            }
            else
            {
                setImageColor(answer.GetComponent <Image> (), "#EA4758FF");
            }
            i++;
        }

        getAnswersPanelLeftElements().ForEach(child => Destroy(child));

        return((int)Math.Floor((double)getPoints() * correct / correctOrder.Length));
    }
Esempio n. 2
0
 private new void Awake()
 {
     sInstance = this;
     this.gameObject.SetActive(false);
     mainCameraA = GameObject.Find("MainCamera").GetComponent <Camera>();
     base.Awake();
 }
Esempio n. 3
0
 public override void Reset()
 {
     slot = null;
     id   = new FsmInt {
         UseVariable = true
     };
 }
Esempio n. 4
0
    public override int evaluate()
    {
        int correct = 0;

        List <GameObject> answerPanelElements = getAnswersPanelRightElements();

        for (int i = 0; i < answerPanelElements.Count; i++)
        {
            DragSlot   answerSlot = answerPanelElements [i].GetComponent <DragSlot> ();
            GameObject answer     = answerSlot.item;
            answer.GetComponent <DragHandler> ().enabled = false;
            if (answer.GetComponentInChildren <Text> ().text == correctOrder [i])
            {
                setImageColor(answer.GetComponent <Image> (), "#8CE5B9FF");
                correct++;
            }
            else
            {
                setImageColor(answer.GetComponent <Image> (), "#EA4758FF");
            }
        }

        getAnswersPanelLeftElements().ForEach(child => Destroy(child));

        if (correct == correctOrder.Length)
        {
            return(getPoints());
        }
        if (correct > 0)
        {
            return((int)getPoints() / 2);
        }
        return(0);
    }
Esempio n. 5
0
    public void MouseDrop()                                 // スロットの上にアイテムがドロップされた時に実行
    {
        if (FindObjectOfType <DragSlot>() == null || panelParam)
        {
            return;
        }

        foreach (Transform child in customslot_c)
        {
            child.gameObject.transform.GetComponent <CustomSlot>().BatsuEnd();
        }

        AudioManager.Instance.PlaySE("closing-wooden-door-1");
        transform.GetChild(0).GetComponent <Image>().sprite = null;
        myItemData = null;

        dragSlot   = FindObjectOfType <DragSlot>();    // DragItemUIに設定しているDragItemDataスクリプトからアイテムデータを取得
        myItemData = dragSlot.GetItem();
        int id = myItemData.GetItemId();

        if (id > 2 && panelParam == false)
        {
            itemSlot = dragSlot.GetSlotData();            //ドラッグしてきた持ち物パネルを取得持ち物
            //Debug.Log(itemSlot);

            ShowInformation();

            //カスタムパネルに装備
            panelParam = true;
            pocketStatus.SetItemData(myItemData, slotNum);


            switch (dragSlot.GetDeleteNum())
            {
            case 1:
                myItemStatus.SetItemCount(id, -1);
                ProcessingSlot processingSlot = itemSlot.GetComponent <ProcessingSlot>();
                StartCoroutine(processingSlot.displayCount());

                if (myItemStatus.GetItemCount(id) <= 0)
                {
                    myItemStatus.SetItemFlag(id, false);
                    itemSlot.GetComponent <ProcessingSlot>().PanelDelete();
                }

                break;

            case 3:

                itemSlot.GetComponent <PocketItem>().PanelDelete();
                break;

            default:
                break;
            }
        }
        dragSlot.DeleteDragItem();                          // ドラッグしているアイテムデータの削除
        //pocketStatus.SetItemData(myItemData, slotNum);
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        SoundManager.GetInstance().StopAllLoopingSoundEffects();

        remoteUserPanel = transform.Find("Panel").gameObject;
        remoteUserPanel.transform.Find("Callee").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures/Photos/Profile/" + UserDataController.GetInstance().CalleeImage);
        transform.Find("BottomBar/Tab/Name").GetComponent <Text>().text        = UserDataController.GetInstance().CalleeUserName;

        if (UserDataController.GetInstance().ActiveUserType == UserDataController.UserType.Senior)
        {
            transform.Find("BottomBar/InCall/Mic").gameObject.SetActive(false);
            transform.Find("BottomBar/InCall/Sound").gameObject.SetActive(false);
        }

        CalleeCanvasZoom   = remoteUserPanel.GetComponent <RectTransform>();
        calleeCanvas       = remoteUserPanel.transform.Find("VideoCallee").GetComponent <CanvasRenderer>();
        CalleeOriginalSize = remoteUserPanel.transform.Find("VideoCallee").GetComponent <RectTransform>().sizeDelta;
        CallTime           = transform.Find("BottomBar/Tab/Calling").GetComponent <Text>();

        if (UserDataController.GetInstance().ActiveUserType == UserDataController.UserType.Senior)
        {
            transform.Find("BottomBar/InCall/Sound").gameObject.SetActive(false);
            transform.Find("BottomBar/InCall/Mic").gameObject.SetActive(false);
        }

        StartCoroutine(CallTimer());

        localUserPanel = transform.Find("UserPanel").gameObject;
        UserPanelRef   = localUserPanel.AddComponent <UserPanel>();
        endCall        = transform.Find("BottomBar/InCall/EndCall").GetComponent <Button>();

        endCall.onClick.AddListener(() =>
        {
            SoundManager.GetInstance().PlaySingle("SoundFX/pop_drip");
            videoCall.GetComponent <VideoCall>().Restart();
        });

        GameObject videoCallPrefab = Resources.Load <GameObject>("Prefabs/SeniorCall/VideoCall");

        videoCall = GameObject.Instantiate <GameObject>(videoCallPrefab);
        videoCall.transform.SetParent(this.transform);
        videoCall.transform.localPosition = Vector3.zero;

        StartCoroutine(videoCall.GetComponent <VideoCall>().SetupVideo(OnVideoStart));
        DragSlot dragComponent = transform.Find("SharedPhoto/DragSlot").gameObject.AddComponent <DragSlot>();

        dragComponent.method += PhotoDragHandler;
        NetworkController.GetInstance().OnPhotoReceived += ReceivedNetworkPhoto;
    }
Esempio n. 7
0
    public void DropSlot(DragSlot slot)
    {
        if (slot == null)
        {
            _parent   = _startParent;
            _position = _startPosition;
        }
        else
        {
            _parentSlot = slot;

            _parent       = _parentSlot.transform;
            _slotPosition = _parentSlot.transform.position;
            _position     = _slotPosition;
        }
    }
Esempio n. 8
0
 public void FlyToSlot(DragSlot slot)
 {
     mSlot.mDragChild = null;
     if(slot.mDragChild!=null)
     {
     //			DragSlot mslot = mSlot;
         mSlot.mDragChild = null;
         slot.mDragChild.FlyToSlot(mSlot);
     }
     mSlot = slot;
     slot.AddDragChildToSlot(this);
     flyTime = 0;
     isFly = true;
     fromPos = transform.position;
     toPos = slot.transform.position;
 }
Esempio n. 9
0
 private void Start()
 {
     instance = this;
 }
Esempio n. 10
0
 void Start()
 {
     instance = this;
 }
Esempio n. 11
0
 void Start()
 {
     instance   = this;
     _itemImage = GetComponent <Image>();
 }
Esempio n. 12
0
 void Start()
 {
     instance = this; //자기자신을 넣어서 초기화
 }
Esempio n. 13
0
    public void MouseDrop()     // スロットの上にアイテムがドロップされた時に実行
    {
        if (FindObjectOfType <DragSlot>() == null || panelParam)
        {
            return;
        }

        foreach (Transform child in itemslot_c)
        {
            child.gameObject.transform.GetComponent <PocketItem>().BatsuEnd();
        }

        AudioManager.Instance.PlaySE("closing-wooden-door-1");
        dragSlot   = FindObjectOfType <DragSlot>();    // DragItemUIに設定しているDragItemDataスクリプトからアイテムデータを取得
        myItemData = dragSlot.GetItem();
        id         = myItemData.GetItemId();

        dataName = dragSlot.GetSlotData();             //ドラッグしてきた持ち物パネルを取得

        switch (panelParam)
        {
        case false:
            if (myItemData.GetItemSet() == PocketStatus.Pocket.none)
            {
                switch (id)
                {
                default:
                case 0:
                    plusPower = myItemData.GetItemPower();
                    break;

                case 1:
                    plusPower = myItemData.GetItemSpeed();
                    break;

                case 2:
                    plusPower = myItemData.GetItemDefence();
                    break;
                }

                wm.AttachParts(plusPower, id);

                ShowInformation();

                panelParam = true;
            }

            break;

        default:

            dataName = null;

            break;
        }

        if (myItemData.GetItemSet() != PocketStatus.Pocket.none)
        {
            return;
        }

        switch (dragSlot.GetDeleteNum())
        {
        case 1:
            myItemStatus.SetItemCount(id, -1);
            var processingSlot = dataName.GetComponent <ProcessingSlot>();
            processingSlot.StartCoroutine("displayCount");

            if (myItemStatus.GetItemCount(id) <= 0)
            {
                myItemStatus.SetItemFlag(id, false);
                processingSlot.PanelDelete();
            }

            break;

        case 2:
            dataName.GetComponent <CustomSlot>().PanelDelete();
            break;

        case 3:
            break;

        default:
            break;
        }
        dragSlot.DeleteDragItem();                          // ドラッグしているアイテムデータの削除
    }
Esempio n. 14
0
 public override void Reset()
 {
     slot = null;
 }
Esempio n. 15
0
 private void Awake()
 {
     instance = this;
     imgItem  = GetComponent <Image>();
 }