Скрипт работы луча обнаружения целей

← разместить еще код

Расшаренный код:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LuchWork : MonoBehaviour {
    public float nacaloSector;
    public float KonecSector;
    public float seredinaU;
    public float UgolLuch;

    public int e = 0;

    public float ugolToAim;
    public float EkstrpolTime;
    public float SetEkstrpolTime;

    public float DieTime;
    public float RandomDieTime;
    public bool Visible = true;
    public float ZahvatTime;
    public int Sdv;
    public int i = 0;

    public int iSopr = 0;
    public int aimCount = 0;
    public int LoopCount;
    public bool LoopCountOn;

    public Image OjidanColor;
    public Text OjidanText;

    public Image KrugRazvedOt;
    public GameObject seredina;
    public Image KrugRazvedDo;
    public bool Count = false;
    public bool Poisk = false;
    public bool Sopr = false;
    public bool Pod = false;
    public bool PoiskPod = false;
    public float TimeToPoiskPod;
    public bool Poisk1 = false;
    public bool RotToRaz = true;
    public float RotateSpeed;
    public float SetRotateSpeed;

    public GameObject luch;
    public GameObject luchUM;
    public GameObject luchF;
    public GameObject Panel;
    public List <GameObject> aims;
    public List <GameObject> aimsFant;
    public List <GameObject> aimsF;
    public List <GameObject> aimsFfant;
    public List <GameObject> aimsUM;
    public List <GameObject> aimsUMfant;

    public List <Toggle> tg;

    public Toggle tgDej;
    public Toggle tgPoisk;
    public Toggle tgSopr;
    public Toggle tgPod;


    public GameObject pomehaYes;

    public bool AimsOnOnStart;
    public float TimeAimsOnOnStart;

    public Toggle tgloff;

    public GameObject spoTimer;

    public GameObject PomehaNo;

	// Update is called once per frame
    void Start(){
        
    }
   

    void Update () {

        if (spoTimer.GetComponent<SpoTimer>().t > 1200)
        {
            for (int i = 0; i < aimsUMfant.Count; i++)
            {
                aimsUMfant[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y + 2000);
            }
        }

        if (!AimsOnOnStart)
        {
            TimeAimsOnOnStart = TimeAimsOnOnStart + Time.deltaTime;

                for (int kl = 0; kl != aims.Count; kl++)
                {
                    aims[kl].SetActive(true);

                    aimCount = aims.Count;                   
                }


                if (TimeAimsOnOnStart > 1)
                {
                    for (int kl = 0; kl != aims.Count; kl++)
                    {
                        aims[kl].SetActive(false);
                    }
                    AimsOnOnStart = true;
                }

        }

        seredinaU = KrugRazvedOt.transform.eulerAngles.z - (KrugRazvedOt.fillAmount * 180);
        nacaloSector = KrugRazvedOt.transform.eulerAngles.z;
        KonecSector = KrugRazvedDo.transform.eulerAngles.z;

        LoopCount = luch.GetComponent<LoopCount>().LpCnt;
        UgolLuch = luch.transform.eulerAngles.z;

        if (tgPoisk.transform.Find("ButGreen").gameObject.activeInHierarchy == true)
        {
            Poisk = true;
            Visible = true;
            StaticScript.SpoControlDej = false;
            PoiskPod = false;
            Poisk1 = false;
            TimeToPoiskPod = 0;
            tgPod.transform.Find("ButGreenPoiskPod").gameObject.SetActive(false);
        }

        if (tgPoisk.transform.Find("ButGreen").gameObject.activeInHierarchy == false)
        {
            Poisk = false;
        }

        if (tgSopr.transform.Find("ButGreen").gameObject.activeInHierarchy == true)
        {
            Sopr = true;
            tgPod.transform.Find("ButGreenPoiskPod").gameObject.SetActive(false);
            PoiskPod = false;
            Poisk1 = false;
            TimeToPoiskPod = 0;

        }

        if (tgSopr.transform.Find("ButGreen").gameObject.activeInHierarchy == false)
        {
            Sopr = false;
            ZahvatTime = 0;
        }

        if (tgPod.transform.Find("ButGreen").gameObject.activeInHierarchy == true)
        {
            Pod = true;
        }

        if (tgPod.transform.Find("ButGreen").gameObject.activeInHierarchy == false)
        {
            Pod = false;
            pomehaYes.SetActive(false);
        }

        if (tgDej.transform.Find("ButGreen").gameObject.activeInHierarchy == true)
        {
            OjidanColor.color = new Color32(0, 255, 0, 255);
            OjidanText.text = "ОЖИДАНИЕ";
            StaticScript.SpoControlDej = true;
            PoiskPod = false;
            tgPod.transform.Find("ButGreenPoiskPod").gameObject.SetActive(false);
        }


        if (Pod && Visible == true && Poisk1 == false)
        {
            RotateSpeed = 15;
            transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(0, 0, aimsFant[iSopr].transform.eulerAngles.z), Time.deltaTime * RotateSpeed);
            luchUM.GetComponent<UMZonaMoveLuch>().enabled = false;
            luchUM.transform.localPosition = Vector2.MoveTowards(luchUM.transform.localPosition, new Vector2(luchUM.transform.localPosition.x, aimsUMfant[iSopr].transform.localPosition.y), 0.5f);


            if (/*aimsFant[iSopr].transform.eulerAngles.z >= luch.transform.eulerAngles.z - 1 && aimsFant[iSopr].transform.eulerAngles.z <= luch.transform.eulerAngles.z + 1*/
                Quaternion.Angle(aimsFant[iSopr].transform.rotation, luch.transform.rotation) <= ugolToAim && (aimsUMfant[iSopr].transform.position.y <= luchUM.transform.position.y + 15) && (aimsUMfant[iSopr].transform.position.y >= luchUM.transform.position.y - 15))
            {
                aims[iSopr].SetActive(true);
                aims[iSopr].transform.rotation = Quaternion.Euler(0, 0, aimsFant[iSopr].transform.eulerAngles.z);
                aimsF[iSopr].SetActive(true);
                aimsF[iSopr].transform.position = new Vector2(aimsFfant[iSopr].transform.position.x - Sdv, aimsF[iSopr].transform.position.y);
                aimsUM[iSopr].SetActive(true);
                aimsUM[iSopr].transform.position = new Vector2(aimsUMfant[iSopr].transform.position.x, aimsUMfant[iSopr].transform.position.y);

                EkstrpolTime = EkstrpolTime + Time.deltaTime;
                DieTime = DieTime + Time.deltaTime;
                SetEkstrpolTime = (1000 - aimsUMfant[iSopr].transform.position.y) / 90;

                if (EkstrpolTime < SetEkstrpolTime)
                {
                    aims[iSopr].transform.Find("AimColor/target").gameObject.GetComponent<Image>().color = UnityEngine.Color.red;
                    OjidanColor.color = new Color32(255, 0, 0, 255);
                    OjidanText.text = "ПОДАВЛЕНИЕ";
                    pomehaYes.SetActive(true);
                    PomehaNo.SetActive(false);
                }

                if (EkstrpolTime >= SetEkstrpolTime )
                {
                    OjidanColor.color = new Color32(255, 255, 0, 255);
                    OjidanText.text = "ЭКСТРАПОЛ";
                    pomehaYes.SetActive(false);
                    PomehaNo.SetActive(true);
                    aims[iSopr].transform.Find("AimColor/target").gameObject.GetComponent<Image>().color = UnityEngine.Color.yellow;
                    if (EkstrpolTime > SetEkstrpolTime*1.3f)
                        EkstrpolTime = 0;
                }

                if (DieTime > RandomDieTime)
                {
                    if (StaticScript.AimDie == 1)
                    {
                        tgloff.isOn = true;
                        aims[iSopr].GetComponent<AimDie>().Die();
                        Visible = false;
                        PomehaNo.SetActive(true);
                        PoiskPod = true;

                    }

                    if (StaticScript.AimDie == 2)
                    {
                        tgloff.isOn = true;
                        aims[iSopr].GetComponent<AimDie>().Die();
                        aimsUMfant[iSopr].transform.position = new Vector2(aimsUMfant[iSopr].transform.position.x, aimsUMfant[iSopr].transform.position.y + 2000);
                        Visible = false;
                        PomehaNo.SetActive(true);
                        PoiskPod = true;

                    }

                    if (StaticScript.AimDie == 3)
                    {
                        
                    }

                    DieTime = 0;
                    EkstrpolTime = 0;

                }

            }
            else
            {
                OjidanColor.color = new Color32(255, 255, 0, 255);
                OjidanText.text = "НАВЕДЕНИЕ";
                pomehaYes.SetActive(false);

            }
        }

        if (PoiskPod)
        {
            TimeToPoiskPod = TimeToPoiskPod + Time.deltaTime;
            if (TimeToPoiskPod > 0.5f)
            {
                Poisk1 = true;
                TimeToPoiskPod = 0;
                PoiskPod = false;
                Pod = false;
                tgPod.transform.Find("ButGreen").gameObject.SetActive(false);
                tgPod.transform.Find("ButGreenPoiskPod").gameObject.SetActive(true);
                luchUM.GetComponent<UMZonaMoveLuch>().enabled = true;
//                Poisk = true;
                Visible = true;
//                StaticScript.SpoControlDej = false;
//                PoiskPod = false;
//                Poisk1 = false;
//                TimeToPoiskPod = 0;
            }
        }


        if (Sopr)
        {
            RotateSpeed = 15;
            transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(0, 0, aimsFant[iSopr].transform.eulerAngles.z), Time.deltaTime * RotateSpeed);
            luchUM.GetComponent<UMZonaMoveLuch>().enabled = false;
            luchUM.transform.localPosition = Vector2.MoveTowards(luchUM.transform.localPosition, new Vector2(luchUM.transform.localPosition.x, aimsUMfant[iSopr].transform.localPosition.y), 0.5f);
            OjidanColor.color = new Color32(255, 255, 0, 255);
            OjidanText.text = "НАВЕДЕНИЕ";
            aims[iSopr].transform.Find("AimColor/target").gameObject.GetComponent<Image>().color = UnityEngine.Color.white;
            if (aimsFant[iSopr].transform.eulerAngles.z >= luch.transform.eulerAngles.z - 1 && aimsFant[iSopr].transform.eulerAngles.z <= luch.transform.eulerAngles.z + 1)
            {
                aims[iSopr].SetActive(true);
                aims[iSopr].transform.rotation = Quaternion.Euler(0, 0, aimsFant[iSopr].transform.eulerAngles.z);
                aimsF[iSopr].SetActive(true);
                aimsF[iSopr].transform.position = new Vector2(aimsFfant[iSopr].transform.position.x - Sdv, aimsF[iSopr].transform.position.y);
                aimsUM[iSopr].SetActive(true);
                aimsUM[iSopr].transform.position = new Vector2(aimsUMfant[iSopr].transform.position.x, aimsUMfant[iSopr].transform.position.y);

                ZahvatTime = ZahvatTime + Time.deltaTime;

                if (ZahvatTime < 1)
                {
                    aims[iSopr].transform.Find("AimColor/target").gameObject.GetComponent<Image>().color = UnityEngine.Color.yellow;
                    OjidanColor.color = new Color32(255, 255, 0, 255);
                    OjidanText.text = "ЗАХВАТ";
                }

                if (ZahvatTime > 1)
                {
                    aims[iSopr].transform.Find("AimColor/target").gameObject.GetComponent<Image>().color = UnityEngine.Color.green;
                    OjidanColor.color = new Color32(0, 255, 0, 255);
                    OjidanText.text = "СОПРОВ.";
                }

                if (ZahvatTime > 6)
                {
                    ZahvatTime = 0;
                }



            }



        }

        if (Poisk || Poisk1 == true)
        {
            i = 0;
            while (i < aims.Count)
            {
                
                if (Quaternion.Angle(aimsFant[i].transform.rotation, luch.transform.rotation) <= ugolToAim && (aimsUMfant[i].transform.position.y <= luchUM.transform.position.y + 15) && (aimsUMfant[i].transform.position.y >= luchUM.transform.position.y - 15))
                {
                    
                    //0
                    if (tg[0].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 0 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 400) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 0 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 400))
                        {
                            
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                                //GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }

                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                                //GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //0

                    //1
                    if (tg[1].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 400 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 800) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 400 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 800))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                                // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                               // GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //1

                    //2
                    if (tg[2].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 800 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 1200) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 800 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 1200))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                                // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                               // GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //2

                    //3
                    if (tg[3].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 1200 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 1600) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 1200 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 1600))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                               // GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //3

                    //4
                    if (tg[4].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 1600 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 2000) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 1600 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 2000))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                               // GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //4

                    //5
                    if (tg[5].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 2000 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 2400) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 2000 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 2400))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                                //GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //5

                    //6
                    if (tg[6].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 2400 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 2800) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 2400 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 2800))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                              //  GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //6

                    //7
                    if (tg[7].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 2800 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 3200) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 2800 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 3200))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                              //  GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //7

                    //8
                    if (tg[8].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 3200 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 3600) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 3200 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 3600))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                               // GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //8

                    //9
                    if (tg[9].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 3600 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 4000) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 3600 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 4000))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                             //   GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                              //  GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //9

                    //10
                    if (tg[10].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 4000 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 4400) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 4000 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 4400))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                             //   GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //10

                    //11
                    if (tg[11].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 4400 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 4800) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 4400 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 4800))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                               // GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                              //  GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //11

                    //12
                    if (tg[12].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 4800 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 5200) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 4800 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 5200))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                             //   GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //12

                    //13
                    if (tg[13].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 5200 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 5600) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 5200 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 5600))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                             //   GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                              //  GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //13

                    //14
                    if (tg[14].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 5600 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 6000) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 5600 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 6000))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                             //   GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //14

                    //15
                    if (tg[15].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 6000 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 6400) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 6000 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 6400))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHierarchy == true)
                                {
                                    aimsF[i].SetActive(true);
                                    if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                        aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                    else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                    aimsUM[i].SetActive(true);
                                    aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);
                                }
                            }
                            if (aims[i].activeInHierarchy == true)
                            {
                             //   GetComponent<AimsAndTotalCount>().enabled = false;
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (StaticScript.AimParam == 1 || StaticScript.AimParam == 3)
                                    aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f / 80);
                                else aimsF[i].transform.localPosition = new Vector2(aimsFfant[i].transform.localPosition.x - Sdv, aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f / 80);
                                aimsUM[i].transform.position = new Vector2(aimsUMfant[i].transform.position.x, aimsUMfant[i].transform.position.y);

                            }
                        }
                    }
                    //15

                    //16
                    if (tg[16].GetComponent<Toggle>().isOn == true)
                    {
                        if ((aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f >= 6400 && aims[i].transform.Find("AimColor").GetComponent<AimParamConst>().f < 6800) || (aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f >= 6400 && aims[i].transform.Find("AimColor").GetComponent<AimParamFluent>().f < 6800))
                        {
                            if (aims[i].activeInHierarchy == false)
                            {
                                luch.GetComponent<AimsAndTotalCount>().tc = luch.GetComponent<AimsAndTotalCount>().tc + 1;
                              //  GetComponent<AimsAndTotalCount>().enabled = true;
                                aims[i].SetActive(true);
                                aims[i].transform.rotation = Quaternion.Euler(0, 0, aimsFant[i].transform.eulerAngles.z);
                                if (aims[i].transform.Find("AimColor").gameObject.activeInHier