public static void Flash(GameObject go, bool active, bool addIfNull = true)
    {
        OutlineObj obj = go.GetComponent <OutlineObj>();

        if (obj == null)
        {
            if (active == false)
            {
                addIfNull = false;
            }
            if (addIfNull)
            {
                obj         = go.AddComponent <OutlineObj>();
                obj.enabled = false;
            }
            else
            {
                return;
            }
        }

        if (active)
        {
            obj.enabled = true;
            obj.FlashingOn();
        }
        else
        {
            obj.FlashingOff();
            obj.enabled = false;
        }
    }
Пример #2
0
 //出海按钮(地球选图)
 public void Earth_Btn()
 {
     if (UIstate == 0)
     {
         main_UI.SetActive(false);
         earth_UI.SetActive(true);
         UIstate = 1;
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = false;
         main_cam.GetComponent <RapidBlurEffect>().enabled = true;
         earth_cam.SetActive(true);
         OutlineObj.GetComponent <Outline_Init>().Dis_MouseEnter();
         earth.GetComponent <Outline_Init>().Init();
     }
     else if (UIstate == 1)
     {
         earth_UI.SetActive(false);
         main_UI.SetActive(true);
         UIstate = 0;
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = true;
         main_cam.GetComponent <RapidBlurEffect>().enabled = false;
         earth_cam.SetActive(false);
         main_cam.GetComponent <OutlineEffect>().enabled = true;
         OutlineObj.GetComponent <Outline_Init>().Init();
         OutlineObj.GetComponent <Outline_Init>().MouseEnter();
     }
 }
 public static void Flash_WithOutEnable(OutlineObj obj, bool active)
 {
     if (active)
     {
         obj.FlashingOn();
     }
     else
     {
         obj.FlashingOff();
     }
 }
 public static void Constant_WithOutEnable(OutlineObj obj, bool active)
 {
     if (active)
     {
         obj.ConstantOn();
     }
     else
     {
         obj.ConstantOff();
     }
 }
    public static void Stop(GameObject go)
    {
        //OutlineCamera.blurMaterial.color
        OutlineObj obj = go.GetComponent <OutlineObj>();

        if (obj != null)
        {
            //
            obj.Off();
        }
    }
Пример #6
0
 public void Museum_btn()
 {
     if (UIstate == 0)
     {
         museum_UI.SetActive(true);
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = false;
         UIstate = 4;
         OutlineObj.GetComponent <Outline_Init>().Dis_MouseEnter();
     }
     else if (UIstate == 4)
     {
         museum_UI.SetActive(false);
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = true;
         UIstate = 0;
         OutlineObj.GetComponent <Outline_Init>().MouseEnter();
     }
 }
Пример #7
0
 //商店按钮
 public void Store_Btn()
 {
     if (UIstate == 0)
     {
         store_UI.SetActive(true);
         UIstate = 2;
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = false;
         OutlineObj.GetComponent <Outline_Init>().Dis_MouseEnter();
     }
     else if (UIstate == 2)
     {
         store_UI.SetActive(false);
         UIstate = 0;
         GameObject.Find("CamCube").GetComponent <CamCubeControl>().move = true;
         OutlineObj.GetComponent <Outline_Init>().MouseEnter();
         //main_cam.GetComponent<OutlineEffect>().enabled = true;
         //OutlineObj.GetComponent<Outline_Init>().Init();
     }
 }
Пример #8
0
 //造船厂按钮
 public void Dockyard_btn()
 {
     if (UIstate == 0)
     {
         main_cam.GetComponent <CamToDockyard>().ToDockyard();
         dockyard_UI.SetActive(true);
         OutlineObj.GetComponent <Outline_Init>().Dis_MouseEnter();
         UIstate = 5;
         shipyard_middleship.SetActive(true);
         dockyard_UI.GetComponent <Animator>().Play("ship_yard_test");
     }
     else if (UIstate == 5)
     {
         main_cam.GetComponent <CamToDockyard>().OutDockyard();
         dockyard_UI.SetActive(false);
         UIstate = 0;
         OutlineObj.GetComponent <Outline_Init>().MouseEnter();
         shipyard_middleship.SetActive(false);
         //main_cam.GetComponent<OutlineEffect>().enabled = true;
         //OutlineObj.GetComponent<Outline_Init>().Init();
     }
 }
 void OutlineConstant(OutlineObj outline, bool isTrue)
 {
     outline.constantly = isTrue;
 }
 void OutlineFlicker(OutlineObj outline, bool isTrue)
 {
     outline.flicker = isTrue;
 }