public static void AddImageTrue() { GameObject[] obj = Selection.gameObjects; for (int i = 0; i < obj.Length; i++) { //Object o = obj[i]; //if (o == null) //{ // continue; //} GameObject gameObj = obj[i]; if (gameObj == null) { continue; } Image img = gameObj.GetComponent <Image>(); if (img == null) { continue; } TweenAlpha tweenAlpha = gameObj.GetComponent <TweenAlpha>(); if (tweenAlpha == null) { continue; } GameBaseFunction func = gameObj.AddComponent <GameBaseFunction>(); tweenAlpha.AddTweenCompletedCallback(func.SetImageTrue); img.raycastTarget = false; } }
protected override void OnInit() { base.OnInit(); m_win_continue_btn = Make <GameButton>("btnSure"); m_lvl_up_detail_view = Make <WinLvlUpDetailView>("Panel_level"); m_lvl_up_reward_view = Make <WinLvlUpRewardView>("Panel_levelupreward"); m_lvl_up_reward_cg = m_lvl_up_reward_view.GetComponent <CanvasGroup>(); m_lvl_up_reward_hide_tween = m_lvl_up_reward_view.GetComponents <TweenAlpha>().Where((e) => UITweenerBase.TweenTriggerType.OnHide == e.m_triggerType).FirstOrDefault(); m_lvl_up_reward_hide_tween.AddTweenCompletedCallback(LvlUpRewardHideFinished); m_normal_reward_view = Make <WinNormalRewardView>("Panel_reward"); //m_win_effect = Make<GameUIEffect>("RawImage:UI_changjing_jiesuan"); //m_win_effect.EffectPrefabName = "UI_changjing_jiesuan.prefab"; //m_win_effect.Visible = false; }
public override void OnShow(object param) { base.OnShow(param); m_tween_alpha.AddTweenCompletedCallback(OnTweenFinished); }