コード例 #1
0
ファイル: Skill.cs プロジェクト: kimjunhwi/OuchMercenary
    public IEnumerator NoneDelaySkill()
    {
        yield return(new WaitForSeconds(0.1f));

        if (activeSkill.m_strAttackPriority == "enemy")
        {
            TargetList = characterManager.FindEnemyDistanceArea(transform.position, activeSkill.m_fAttackRange, Skiller_Type);
        }

        else
        {
            TargetList = characterManager.FindFriendDistanceArea(transform.position, activeSkill.m_fAttackRange, Skiller_Type);
        }

        string[] strActiveTypes = activeSkill.m_strSkillType.Split(',');

        for (int nIndex = 0; nIndex < strActiveTypes.Length; nIndex++)
        {
            AllActiveSkillType skillData = GameManager.Instance.cAllActiveType[int.Parse(strActiveTypes[nIndex])];

            skillManager.ActiveSkill(skillData.nActiveType, activeSkill, skiller, TargetList, false);
        }

        yield return(new WaitForSeconds(1.0f));

        objectPool.ReturnObject(gameObject);
    }
コード例 #2
0
    public void ButtonClicked(GameObject button)
    {
        if (currentNumber == button.GetComponent <Button>().N)
        {
            Score += currentNumber;
            if (currentNumber == level + 4)
            {
                FinishLevel();
            }
            else
            {
                currentNumber++;
            }

            buttonObjectPool.ReturnObject(button);
            buttonGameObjects.Remove(button);
        }
        else
        {
            FinishLevel();

            RemoveAllButtons();

            Score = 0;
            level = (int)PreferredLevel;
        }
    }
コード例 #3
0
ファイル: QusetManager.cs プロジェクト: kimjunhwi/BlackSmith
    public void CheckQuestDestroy()
    {
        QuestPanel deleteQuestPanel = null;

        for (int i = 0; i < questDay.transform.childCount; i++)
        {
            GameObject go = questDay.transform.GetChild(i).gameObject;
            deleteQuestPanel = go.GetComponent <QuestPanel> ();

            if (deleteQuestPanel.bIsQuest == false)
            {
                deleteQuestPanel.bIsQuest = false;
                deleteQuestPanel.startButton.SetActive(false);
                questObjectPool.ReturnObject(go);
                questObjects.Remove(deleteQuestPanel);
                questPopUpWindow_YesButton.onClick.RemoveListener(CheckQuestDestroy);
                questPopUpWindow_YesButton.onClick.RemoveListener(() => GameObjectSetActive(questPopUpWindow_YesNo, false));
                deleteQuestPanel = null;
            }
        }

        //퀘스트 타이머의 시간이 꺼져있을때
        if (questTimer.isTimeOn == false)
        {
            questTimer.StartQuestTimer();
        }
    }
コード例 #4
0
 private void RemoveButtons()
 {
     while (contentPanel.childCount > 0)
     {
         GameObject toRemove = transform.GetChild(0).gameObject;
         buttonObjectPool.ReturnObject(toRemove);
     }
 }
コード例 #5
0
 //*** rework the add item to list
 // make a proper add item to list with sort and filter in mind
 // TODO : 우클릭 시에 원래자리로 돌아가도록 인벤그리드매니저에 추가.
 private void Update()
 {
     if (Input.GetMouseButtonDown(1) && invenManager.selectedButton != null) //right click to return item to list if item is from list
     {
         invenManager.RefreshColor(false);
         invenManager.selectedButton.GetComponent <CanvasGroup>().alpha = 1f;
         invenManager.selectedButton = null;
         itemEquipPool.ReturnObject(ItemScript.selectedItem);
         ItemScript.ResetSelectedItem();
     }
 }
コード例 #6
0
ファイル: ManagerGraph.cs プロジェクト: DOD14/Nodes
    // Update is called once per frame
    void Update()
    {
        if (!draggingToggle.isOn && Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hit, 20f))
            {
                currentStartNode = hit.collider.gameObject.GetComponent <Node>();
                if (currentStartNode != null)
                {
                    StartEdge(currentStartNode);
                }
            }
        }

        if (drawing)
        {
            if (Input.GetMouseButton(0) && currentEdge != null)
            {
                Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                pos = new Vector3(pos.x, pos.y, 0f);
                currentEdge.lineRenderer.SetPosition(1, pos);
            }

            else if (Input.GetMouseButtonUp(0))
            {
                RaycastHit hit;
                Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray, out hit, 20f))
                {
                    currentEndNode = hit.collider.gameObject.GetComponent <Node>();
                    if (currentEndNode != null)
                    {
                        EndEdge(currentEndNode);
                    }

                    else
                    {
                        edgePool.ReturnObject(currentEdge.gameObject);
                        currentEdge = null;
                    }
                }

                else
                {
                    currentStartNode = null;
                    edgePool.ReturnObject(currentEdge.gameObject);
                    currentEdge = null;
                }
            }
        }
    }
コード例 #7
0
    void BlocksClear()
    {
        while (Block_List.Count != 0)
        {
            GameObject block = Block_List[0].gameObject;
            normalBlockObjectPool.ReturnObject(block);
            Block_List.RemoveAt(0);
            block.SetActive(false);
        }

        Block_List.Clear();
    }
コード例 #8
0
    public void OnEndDrag(PointerEventData pointerDrag)
    {
        if (childScript.parentToReturnTo.name == this.transform.name)
        {
            childScript.OnEndDrag(pointerDrag);
            objectPool.ReturnObject(newObject);
            return;
        }

        childScript.OnEndDrag(pointerDrag);
        newObject   = null;
        childScript = null;
    }
コード例 #9
0
ファイル: Note2Object.cs プロジェクト: kimjunhwi/BlackSmith
    public void OnPointerDown(PointerEventData eventData)
    {
        getInfoGameObject = eventData.pointerEnter;

        if (getInfoGameObject.gameObject.name == "Note2")
        {
            note2ObjPull.ReturnObject(getInfoGameObject);
            bossMusic.DecreaseRefectionTime(0.25f);
        }
        else
        {
            return;
        }
    }
コード例 #10
0
ファイル: Note2Object.cs プロジェクト: kimjunhwi/BlackSmith2
    public void OnPointerDown(PointerEventData eventData)
    {
        getInfoGameObject = eventData.pointerEnter;

        if (getInfoGameObject.gameObject.name == "Note2")
        {
            SoundManager.instance.PlayTouchMusicNoteSound();
            note2ObjPull.ReturnObject(getInfoGameObject);
            bossMusic.DecreaseRefectionTime(0.25f);
        }
        else
        {
            return;
        }
    }
コード例 #11
0
ファイル: Note3Object.cs プロジェクト: kimjunhwi/BlackSmith2
    public void OnPointerDown(PointerEventData eventData)
    {
        getInfoGameObject = eventData.pointerEnter;

        if (getInfoGameObject.gameObject == null)
        {
            return;
        }

        if (getInfoGameObject.gameObject.name == "Note3")
        {
            //repairObj.MinusWeaponSpeed (fBossSpeed * (fDecreaseWeaponSpeedRate / 4));
            note3ObjPull.ReturnObject(gameObject);
        }
    }
コード例 #12
0
    public void OnPointerDown(PointerEventData eventData)
    {
        getInfoGameObject = eventData.pointerEnter;

        if (getInfoGameObject.gameObject == null)
        {
            return;
        }

        if (getInfoGameObject.gameObject.name == "SmallFireTouch")
        {
            if (nTouchCount > 0)
            {
                nTouchCount--;
            }
            else
            {
                //불씨 하나당 물 충전량 -3%
                repairObj.fSmallFireMinusWater -= 0.03f;
                //불씨 하나당 온도 증가량 10%
                repairObj.fSmallFirePlusTemperatrue -= 0.1f;
                bossfire.nCurFireCount--;
                smallFireObjPull.ReturnObject(getInfoGameObject);
                Debug.Log("CurFireMinusWater : " + repairObj.fSmallFireMinusWater + "/ CurPlusTemperatrue : " + repairObj.fSmallFirePlusTemperatrue);
            }
        }
    }
コード例 #13
0
    IEnumerator WaitToReturnToObjectPool()
    {
        yield return(new WaitForSeconds(5));

        //gameObject.SetActive(false);
        bulletObjectPool.ReturnObject(gameObject);
    }
コード例 #14
0
    protected void ShowInventory(Inventory Inv, Transform Holder)
    {
        if (Inv == null)
        {
            return;              //todo??
        }
        int Slots = Inv.GetSlotsUsed();

        while (Holder.childCount > 0)
        {
            GameObject toRemove = Holder.GetChild(Holder.childCount - 1).gameObject;
            buttonObjectPool.ReturnObject(toRemove);
        }
        for (int i = 0; i < Slots; i++)
        {
            InventoryItem _item = Inv.GetItem(i);
            GameObject    _bt   = buttonObjectPool.GetObject();
            _bt.transform.SetParent(Holder);
            //Button _bt= MonoBehaviour.Instantiate<Button>(m_ItemPrefab, Holder);
            //_bt.GetComponentInChildren<Text>().text = _item.GetName() + " (" + _item.GetCount().ToString() + ")";
            ButtonWithIcon sampleButton = _bt.GetComponent <ButtonWithIcon>();
            sampleButton.ClickCallback = delegate { OnUse(_item); };
            sampleButton.SetText(_item.GetName() + " (" + _item.GetCount().ToString() + ")");
        }
    }
コード例 #15
0
 private void RemoveAnswerButtons()
 {
     foreach (AnswerButton button in answersPanel.GetComponentsInChildren <AnswerButton>())
     {
         answerButtonObjectPool.ReturnObject(button.gameObject);
     }
 }
コード例 #16
0
ファイル: SimplePoolTest.cs プロジェクト: Protosaider/Snake
    private void Update()
    {
        foreach (var item in projectiles)
        {
            projectilesTime[item] -= Time.deltaTime;
        }

        if (nextSpawn <= Time.time)
        {
            if (projectiles.Count > 0 && projectilesTime[projectiles[0]] <= 0f)
            {
                pool.ReturnObject(projectiles[0]);
                projectilesTime.Remove(projectiles[0]);
                projectiles.Remove(projectiles[0]);
            }

            GameObject projectile;
            projectile = pool.GetObject();
            //pool.ReturnObject(projectile);

            projectiles.Add(projectile);

            nextSpawn = Time.time + delta;

            projectilesTime.Add(projectile, livingTime);
        }
    }
コード例 #17
0
ファイル: PostSlot.cs プロジェクト: kimjunhwi/OuchMercenary
    public override void OnPointerUp(PointerEventData eventData)
    {
        if (eventData.pointerCurrentRaycast.gameObject.name == "Get_Button")
        {
            //postPanel사이즈 와 위치 조정
            postPanel.postPanelListTrans.anchoredPosition = new Vector2(postPanel.postPanelListTrans.anchoredPosition.x, postPanel.postPanelListTrans.anchoredPosition.y - postPanel.fInitPostListPosY_Value);
            postPanel.postPanelListTrans.sizeDelta        = new Vector2(postPanel.postPanelListTrans.sizeDelta.x, postPanel.postPanelListTrans.sizeDelta.y - postPanel.fInitPostListHeight_Value);
            //player의 메일 데이터 지우기
            // GameManager.Instance.playerData.GetPlayer().Remove(postSlotMailInfo);
            postSlotMailInfo = null;
            //수정된 플레이어 정보 서버에 업데이트
            //GameManager.Instance.loginManager.StartUpdatePlayerData();

            //해당 메일에 대한 결과창을 보여준다.
            postGetPanel.SetUpPostGetResult_Single();

            //postSlot pool로 되돌림
            PostSimpleObject.ReturnObject(this.gameObject);
            Debug.Log("Get_Button : " + title_Text.text);
        }
        else
        {
            Debug.Log("Clicked");
        }
    }
コード例 #18
0
ファイル: ShopScrollList.cs プロジェクト: MoongK/Pooling
    public void RemoveButtons()
    {
        //Workable 1
        for (var i = transform.childCount - 1; i >= 0; i--)
        {
            var c = transform.GetChild(i);
            if (buttonPool != null)
            {
                buttonPool.ReturnObject(c.gameObject);
            }
            else
            {
                Destroy(c.gameObject);
            }
        }

        // Error code
        //foreach (Transform c in transform)
        //{
        //    if(buttonPool != null)
        //        buttonPool.ReturnObject(c.gameObject);
        //    else
        //        Destroy(c.gameObject);
        //}
    }
コード例 #19
0
 public void UndisplayUser(ChatClient.UserItem u)
 {
     u.convers.dialog.SendButton.interactable = false;
     userButtonPool.ReturnObject(u.userButton);
     u.userButton = null;
     numUsers     = numUsers - 1;
 }
コード例 #20
0
 private void RemoveChoicesButton()
 {
     while (choicesList.Count > 0)
     {
         answerButtonObjectPool.ReturnObject(choicesList[0].gameObject);
         choicesList.RemoveAt(0);
     }
 }
コード例 #21
0
 private void RemoveButtons()
 {
     while (contentPanel.childCount > 0)
     {
         GameObject toRemove = contentPanel.GetChild(0).gameObject;
         optionPanelPool.ReturnObject(toRemove);
     }
 }
コード例 #22
0
 private void RemoveTaskButtons()
 {
     while (ContentPanel.childCount > 0)
     {
         GameObject toRemove = ContentPanel.GetChild(0).gameObject;
         ButtonObjectPool.ReturnObject(toRemove);
     }
 }
コード例 #23
0
 private void RemoveAnswerButtons()
 {
     while (answerButtonGameObjects.Count > 0)
     {
         answerButtonObjectPool.ReturnObject(answerButtonGameObjects[0]); //Send back to object pool to be reused
         answerButtonGameObjects.RemoveAt(0);                             //remove it from list of active game objects
     }
 }
コード例 #24
0
 private void RemoveText()
 {
     while (parentObject.childCount > 0)
     {
         GameObject toRemove = parentObject.GetChild(0).gameObject;
         simpleTextPool.ReturnObject(toRemove);
     }
 }
コード例 #25
0
 void RemoveAnswerButtons()
 {
     while (answerButtonGameObjects.Count > 0)                                                                                               // Return all spawned AnswerButtons to the object pool
     {
         answerButtonObjectPool.ReturnObject(answerButtonGameObjects[0]);
         answerButtonGameObjects.RemoveAt(0);
     }
 }
コード例 #26
0
 public void RemoveButtons()
 {
     while (contentPanel.childCount > 0)
     {
         GameObject toRemove = contentPanel.GetChild(0).gameObject;
         buttonObjectPool.ReturnObject(toRemove);
     }
 }
コード例 #27
0
 private void RemoveButtons()
 {
     while (DictionaryContent.childCount > 0)
     {
         GameObject toRemove = DictionaryContent.GetChild(0).gameObject;
         WordBtnPool.ReturnObject(toRemove);
     }
 }
コード例 #28
0
ファイル: TaskList.cs プロジェクト: martafmstfg/TimeTamer
 //Eliminar todos los renglones mediante el sistema de pooling
 public void EmptyList()
 {
     while (transform.childCount > 0)
     {
         GameObject toRemove = transform.GetChild(0).gameObject;
         renglonPool.ReturnObject(toRemove);
     }
 }
コード例 #29
0
ファイル: GameController.cs プロジェクト: jakkuchan/LucasGame
 private void RemoveAnswerButtons()
 {
     while (answerButtonGameObjects.Count > 0)
     {
         answerButtonObjectPool.ReturnObject(answerButtonGameObjects[0]);
         answerButtonGameObjects.RemoveAt(0);
     }
 }
コード例 #30
0
 private void RemoveStrategyButtons()
 {
     while (strategyButtonGameObjects.Count > 0)
     {
         strategyButtonObjectPool.ReturnObject(strategyButtonGameObjects[0]);
         strategyButtonGameObjects.RemoveAt(0);
     }
 }