Ejemplo n.º 1
0
 public void OnDragEnd()
 {
     if (First_Paturu != null)
     {
         var length = DeleteList.Count;
         //DestoySize = length;
         if (length >= 3)
         {
             DestoyObjs = new GameObject[length];
             debug(length);
             DestoySize = length;
             for (var i = 0; i < length; i++)
             {
                 CScorecount.PaturuMathCount(DeleteList[i].name);
                 DestoyObjs[i] = DeleteList[i];
                 if (DeleteList[i].name == PaturuControy.PazuruTagAndName.FireName)
                 {
                     hitObjV3Pos = DeleteList[i].transform.position;
                 }
                 //Destroy(asdasd);
             }
             if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null)
             {
                 SkillCostManager.GetSkill6Code().BackByMouseKeyUp(DestoyObjs);
             }
             Drag  = false;
             drag2 = false;
         }
         else
         {
             for (int i = 0; i < DeleteList.Count; i++)
             {
                 Smaller(DeleteList[i]);
                 TagModori(DeleteList[i]);
             }
             SwichType = false;//2019,10.6
             DeleteList.Clear();
             drag2 = true;
             if (SkillCostManager.GetSkill6Code() != null)
             {
                 SkillCostManager.GetSkill6Code().BackAllChange2();
             }
         }
         PaturuControy.ColorUpadateCtr = false;
         //PaturuControy.Skill.Water6Swich = false;
         PaturuControy.SetColorAllLight(Paturu.TagName0, Paturu.TagName1, Paturu.TagName2);
         //CScorecount.SetAllSkillCoreCountZero();
         //if (Tag_ColorControlName2!=null)
         //PaturuControy.sethitobjCancel(Tag_ColorControlName2);
         //Debug.Log(Tag_ColorControlName2);
         First_Paturu = null;
         Last_Paturu  = null;
         CLine.LineSwitch();
         CLine.destroyallNode();
         Back = false;
         //drag2 = true;
         //Debug.Log(PaturuControy.Skill.Water6Swich);
     }
 }
Ejemplo n.º 2
0
 void DraggingSKill6(GameObject hitObj, GameObject firstBall, string firstnameTag)
 {
     if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null)
     {
         SkillCostManager.GetSkill6Code().CheckOutOldObjsToBack(hitObj);
         SkillCostManager.GetSkill6Code().DraggingAddOldObjs(firstBall, hitObj, firstnameTag);
     }
 }
Ejemplo n.º 3
0
 void Skill6(GameObject hitObj, GameObject firstBall, string firstnameTag)
 {
     if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null)
     {
         SkillCostManager.GetSkill6Code().SetPazuruName(firstBall.name);
         SkillCostManager.GetSkill6Code().FindOtherChangeName(firstBall, hitObj, firstnameTag);
         //SkillCostManager.GetSkill6Code().FindOtherBackName(hitObj);
     }
 }
Ejemplo n.º 4
0
 void UpdateSkill6()
 {
     if (SkillCostManager.GetSkill6Code() != null)
     {
         if (PaturuControy.waterskill_six.StartCountDown == 0)
         {
             //PaturuControy.waterskill_six.UpdaterCountDown = true;
             SkillCostManager.GetSkill6Code().DraggingByCountDown();
         }
     }
 }
Ejemplo n.º 5
0
 void timerDesty()
 {
     if (DestoySize > 0)
     {
         timer -= Time.deltaTime;
     }
     if (timer <= 0)
     {
         DestoyCount += 1;
         GameObject _light;
         _light = Instantiate(Light, DestoyObjs[DestoyCount - 1].transform.position, Quaternion.Euler(0, 0, 0), null);
         Destroy(DestoyObjs[DestoyCount - 1]);
         debug(DestoyCount);
         DestoySize -= 1;
         timer       = Keeptimer;
         m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_delete, 1.0f, 0.0f);
     }
     if (DestoySize == 0)
     {
         int _count = DeleteList.Count;
         _min.RoleDown(_count);
         _min.PaturuDowns(_count - 1, KakuRiTuControl);
         _min.RinKuDown();
         DeleteList.Clear();
         DestoySize  = -1;
         timer       = Keeptimer;
         DestoyCount = 0;
         sg          = true;
         //PaturuControy.sethitobjCancel(Tag_ColorControlName);
         //if (Tag_ColorControlName2 != null)
         //PaturuControy.sethitobjCancel(Tag_ColorControlName2);
         if (SkillCostManager.GetSkill6Code() != null)
         {
             SkillCostManager.GetSkill6Code().BackAllChange();
         }
         Drag  = true;
         drag2 = true;
     }
 }
Ejemplo n.º 6
0
    void OnDragging()
    {
        var hitcol = GetCurrentHitCollider();

        if (hitcol != null)
        {
            var hitObj = hitcol.gameObject;
            HitObj_ = hitcol.gameObject;
            string nameRk = null;
            nameRk = hitObj.tag;
            //if (Last_Paturu != hitObj&&hitObj!=First_Paturu)
            //WaterSkill6(hitObj);
            if (nameRk == Paturu.RinkuName && !SwichType)
            {
                var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                if (dist <= distance)
                {
                    currentTga = Paturu.RinkuName;
                }
            }
            if (!SwichType && !Back)
            {
                switch (currentTga)
                {
                case "ListType0":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name0 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleWater && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null &&
                                PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                SkillCostManager.GetSkill6Code().CountDownControl(hitObj);
                            }
                            if (PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                DraggingSKill6(hitObj, First_Paturu, FirstNameTag);
                            }
                            //Debug.Log ("asdadsadasdsssssssssssssssssssssssssssss");
                            //  SkillCostManager.GetSkill6Code().CountBackControl(DeleteList);
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }
                    break;

                case "type1":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name1 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleWind && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null &&
                                PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                SkillCostManager.GetSkill6Code().CountDownControl(hitObj);
                            }
                            if (PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                DraggingSKill6(hitObj, First_Paturu, FirstNameTag);
                            }
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            //test(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }

                    break;

                case "type2":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name2 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleFire && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null &&
                                PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                SkillCostManager.GetSkill6Code().CountDownControl(hitObj);
                            }
                            if (PaturuControy.waterskill_six.StartCountDown > 0)
                            {
                                DraggingSKill6(hitObj, First_Paturu, FirstNameTag);
                            }
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }
                    break;

                case "RK":
                    if (Last_Paturu != hitObj && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            SwichType = true;
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }
                    break;
                }
            }
            if (SwichType && !Back)
            {
                switch (nameRk)
                {
                case "ListType0":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name0 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleWater && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            hitObj.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255);
                            Tag_ColorControlName2 = hitObj.tag;
                            PaturuControy.ImagesControy(hitObj, hitObj.tag);
                            //if(Tag_ColorControlName!=hitObj.tag)
                            //PaturuControy.sethitobjCancel(Tag_ColorControlName);
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            currentTga = Paturu.TagName0;
                            SwichType  = false;
                            Debug.Log("sb");
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }
                    break;

                case "type1":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name1 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleWind && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            hitObj.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255);
                            Tag_ColorControlName2 = hitObj.tag;
                            PaturuControy.ImagesControy(hitObj, hitObj.tag);
                            //if (Tag_ColorControlName != hitObj.tag)
                            //PaturuControy.sethitobjCancel(Tag_ColorControlName);
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            currentTga = Paturu.TagName1;
                            SwichType  = false;
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }
                    //Debug.Log(currentTga);
                    break;

                case "type2":
                    if (Last_Paturu != hitObj && hitObj.name == NPaturu.Name2 && hitObj.tag != Paturu.FinishTagName || Last_Paturu != hitObj && hitObj.name == NPaturu.NameRoleFire && hitObj.tag != Paturu.FinishTagName)
                    {
                        var dist = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                        if (dist <= distance)
                        {
                            hitObj.GetComponentInChildren <SpriteRenderer>().color = new Color32(255, 255, 255, 255);
                            Tag_ColorControlName2 = hitObj.tag;
                            PaturuControy.ImagesControy(hitObj, hitObj.tag);
                            //if (Tag_ColorControlName != hitObj.tag)
                            //PaturuControy.sethitobjCancel(Tag_ColorControlName);
                            hitObj.tag = Paturu.FinishTagName;
                            AddDeleteObj(hitObj);
                            linePosCount += 1;
                            lineSize     += 1;
                            CLine.CLineRender(hitObj, linePosCount, lineSize);
                            Bigger(hitObj);
                            currentTga = Paturu.TagName2;
                            SwichType  = false;
                            m_SoundManager.PlaySE((int)GameSoundManager.SoundInfo.se_puzzle_link, 1.0f, startTime);
                        }
                    }


                    break;
                }
            }
            //var dist2 = Vector2.Distance(mousePos(), DeleteList[DeleteList.Count - 2].transform.position);
            if (hitObj.tag == Paturu.FinishTagName && hitObj != Last_Paturu)
            {
                // Last_Paturu = hitObj;
                if (DeleteList.Count > 1)
                {
                    var dist  = Vector2.Distance(Last_Paturu.transform.position, hitObj.transform.position);
                    var dist2 = Vector2.Distance(mousePos(), DeleteList[DeleteList.Count - 2].transform.position);
                    if (dist <= distance && dist2 <= 0.3)
                    {
                        if (SkillCostManager.Skill_Control.Water6Swich && SkillCostManager.GetSkill6Code() != null &&
                            PaturuControy.waterskill_six.StartCountDown >= 0)
                        {
                            SkillCostManager.GetSkill6Code().CountBackControl(DeleteList[DeleteList.Count - 1]);
                        }
                        if (PaturuControy.waterskill_six.StartCountDown >= 0)
                        {
                            DraggingSKill6(hitObj, First_Paturu, FirstNameTag);
                        }
                        Last_Paturu = hitObj;
                        GameObject node;
                        Back = true;
                        Smaller(DeleteList[DeleteList.Count - 1]);
                        TagModori(DeleteList[DeleteList.Count - 1]);
                        if (DeleteList[DeleteList.Count - 1].tag == Paturu.RinkuName)
                        {
                            currentTga = Tag_ColorControlName;
                        }
                        SwichType = false;
                        // DeleteList[DeleteList.Count - 1].tag = "Finish";
                        //Debug.Log(DeleteList[DeleteList.Count - 1].tag);
                        node = CLine.Nodes_list[CLine.Nodes_list.Count - 1];
                        CLine.Nodes_list.Remove(CLine.Nodes_list[CLine.Nodes_list.Count - 1]);
                        Destroy(node);
                        lineSize     -= 1;
                        linePosCount -= 1;
                        CLine.SetlineSize(lineSize);
                        DeleteList.Remove(DeleteList[DeleteList.Count - 1]);
                        // PaturuControy.Skill.Water6Swich = true;
                    }
                }
                else if (DeleteList.Count == 1)
                {
                    Last_Paturu = hitObj;
                    SwichType   = false;
                    //currentTga = hitObj.tag;
                }
                if (hitObj.name == NPaturu.RinkuName)
                {
                    currentTga = Paturu.RinkuName;

                    PaturuControy.sethitobjCancel(Tag_ColorControlName2);
                    PaturuControy.ImagesControy(First_Paturu, Tag_ColorControlName);
                    SwichType = true;
                }
            }
            if (Back)
            {
                {
                    if (hitObj.tag == Paturu.TagName0 || hitObj.tag == Paturu.TagName1 ||
                        hitObj.tag == Paturu.TagName2 || hitObj.tag == Paturu.RinkuName)
                    {
                        Back = false;
                    }
                }
            }
        }
    }