public static SelectedTargetTips CreateInstance() { //暂时只能创建一个 if (m_SingleInstance != null) { return(m_SingleInstance); } SelectedTargetTips TempInstance = null; if (!m_TipsTexture) { m_TipsTexture = Resources.Load(m_TexturePatch) as Texture; } if (!m_TipsTexture) { return(TempInstance); } if (null == m_TipsMaterial) { m_TipsMaterial = new Material(Shader.Find("Effect/BillBorad")); m_TipsMaterial.SetTexture("_MainTex", m_TipsTexture); } BillBoard temp = BillBoard.CreateBillBorad(32, 64, m_TipsMaterial); TempInstance = temp.gameObject.AddComponent <SelectedTargetTips>(); UnityEngine.Object.DontDestroyOnLoad(TempInstance); temp.gameObject.hideFlags = HideFlags.HideAndDontSave; m_SingleInstance = TempInstance; return(TempInstance); }
public void CreateBillBorad() { if (null == BloodMaterial) { BloodMaterial = new Material(Shader.Find("Effect/BillBorad")); BloodMaterial.SetTexture("_MainTex", GfxBloodMovie.BloodRenderTexture); BloodMaterial.name = "BloodMaterial"; BloodMaterial.hideFlags = HideFlags.HideAndDontSave; } if (m_BillBorad == null) { m_BillBorad = BillBoard.CreateBillBorad((int)m_MovieNode.vSize.x, (int)m_MovieNode.vSize.y, BloodMaterial, "Blood -- temp"); } }
public void CreateBillBorad() { if (null == TopNameMaterial) { TopNameMaterial = new Material(Shader.Find("Effect/BillBorad")); TopNameMaterial.SetTexture("_MainTex", TopNameMovie.TopNameRenderTexture); TopNameMaterial.name = "TopNameMaterial"; TopNameMaterial.hideFlags = HideFlags.HideAndDontSave; } if (m_BillBorad == null) { m_BillBorad = BillBoard.CreateBillBorad((int)m_MovieNode.vSize.x, (int)m_MovieNode.vSize.y, TopNameMaterial, "TopName -- temp"); } }