shader fixes
This commit is contained in:
@@ -10,7 +10,8 @@ public class AdventureMenuWindow : SubTaskBaseWindow
|
||||
// Token: 0x060006A8 RID: 1704 RVA: 0x0001B954 File Offset: 0x00019B54
|
||||
public static void SetSubTaskParam(Texture bgTex, bool isNormal)
|
||||
{
|
||||
AdventureMenuWindow.BgTex = bgTex;
|
||||
//TODO troubleshoot sprite stretching
|
||||
//AdventureMenuWindow.BgTex = bgTex;
|
||||
AdventureMenuWindow.IsNormal = isNormal;
|
||||
}
|
||||
|
||||
@@ -51,7 +52,7 @@ public class AdventureMenuWindow : SubTaskBaseWindow
|
||||
int num2 = 272;
|
||||
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
||||
//gameObject.renderer.material = new Material(Resources.Load("Shader/Sprite/Sprite") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("Unlit/Transparent") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("QO/Sprite") as Shader);
|
||||
gameObject.renderer.material.mainTexture = tex;
|
||||
gameObject.transform.parent = base.transform;
|
||||
float num3 = (float)tex.width * scale_w;
|
||||
@@ -97,7 +98,9 @@ public class AdventureMenuWindow : SubTaskBaseWindow
|
||||
Vector3 localPosition = base.transform.parent.localPosition;
|
||||
localPosition.z = -30f;
|
||||
base.transform.parent.localPosition = localPosition;
|
||||
this.MakeTextureObject("BackGround", 0, 0, -1, AdventureMenuWindow.BgTex, 960f / (float)AdventureMenuWindow.BgTex.width, 544f / (float)AdventureMenuWindow.BgTex.height);
|
||||
//TODO troubleshoot sprite stretching
|
||||
//Causes sprite stretching
|
||||
//this.MakeTextureObject("BackGround", 0, 0, -1, AdventureMenuWindow.BgTex, 960f / (float)AdventureMenuWindow.BgTex.width, 544f / (float)AdventureMenuWindow.BgTex.height);
|
||||
}
|
||||
|
||||
// Token: 0x060006B1 RID: 1713 RVA: 0x0001BB98 File Offset: 0x00019D98
|
||||
|
||||
@@ -373,6 +373,7 @@ public abstract class BaseWindow : MonoBehaviourWrap
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
imageObject.SetTexture(fpath);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CreateSprite : MonoBehaviour
|
||||
UnityEngine.Object.Destroy(meshRenderer.material);
|
||||
}
|
||||
//meshRenderer.material = new Material(Resources.Load("Shader/Sprite/Sprite") as Shader);
|
||||
meshRenderer.material = new Material(Shader.Find("Unlit/Transparent") as Shader);
|
||||
meshRenderer.material = new Material(Shader.Find("QO/Sprite") as Shader);
|
||||
meshRenderer.castShadows = false;
|
||||
meshRenderer.receiveShadows = false;
|
||||
MeshFilter meshFilter = gameObject.AddComponent<MeshFilter>();
|
||||
|
||||
@@ -253,16 +253,12 @@ public class EffectManager : MonoBehaviour
|
||||
// Token: 0x060008E4 RID: 2276 RVA: 0x0002728C File Offset: 0x0002548C
|
||||
private static IEnumerator loadTexture()
|
||||
{
|
||||
string path = Pathing.appContentDataPath + Pathing.ToPlatformAssetBundleName(EffectManager.Instance.EffectName);
|
||||
WWW www = new WWW(path);
|
||||
yield return www;
|
||||
AssetBundle ab = www.assetBundle;
|
||||
TextAsset ta = ab.mainAsset as TextAsset;
|
||||
Debug.LogWarning (EffectManager.Instance.EffectName);
|
||||
string path = Application.streamingAssetsPath + Pathing.ToPlatformAssetBundleName(EffectManager.Instance.EffectName);
|
||||
byte[] data = System.IO.File.ReadAllBytes(path + ".png");
|
||||
Texture2D tex = new Texture2D(0, 0, TextureFormat.RGBA32, false, true);
|
||||
tex.LoadImage(ta.bytes);
|
||||
tex.LoadImage(data);
|
||||
tex.wrapMode = TextureWrapMode.Clamp;
|
||||
ab.Unload(true);
|
||||
www.Dispose();
|
||||
EffectManager.Instance.PatternTexture = tex;
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class GalleryMovieWindow : BaseWindow
|
||||
{
|
||||
//TODO fix movie playing. either make platform specific versions OR make platform agnostic
|
||||
//yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/high/op_movie.mp4", FullScreenMovieControlMode.CancelOnInput));
|
||||
yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/high/op_movie.mp4", ""));
|
||||
this.state = GalleryMovieWindow.STATE.END;
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ImageObject : MonoBehaviour
|
||||
{
|
||||
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
||||
//gameObject.renderer.material = new Material(Resources.Load("Shader/Sprite/Sprite") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("Unlit/Transparent") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("QO/Sprite") as Shader);
|
||||
gameObject.transform.parent = parent;
|
||||
gameObject.collider.enabled = collisionEnable;
|
||||
ImageObject imageObject = gameObject.AddComponent<ImageObject>();
|
||||
@@ -190,7 +190,7 @@ public class ImageObject : MonoBehaviour
|
||||
this.imageUnityTexture = unityTexture;
|
||||
base.renderer.material.mainTexture = unityTexture.m_Texture;
|
||||
// TODO issue with changeTexture, fix later
|
||||
// base.renderer.enabled = (this.changeTexture && this.rendererEnableAfterLoad);
|
||||
//base.renderer.enabled = (this.changeTexture && this.rendererEnableAfterLoad);
|
||||
base.renderer.enabled = this.rendererEnableAfterLoad;
|
||||
this.OnTextureLoadComplete2();
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ImageObject2
|
||||
{
|
||||
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Quad);
|
||||
//gameObject.renderer.material = new Material(Resources.Load("Shader/Sprite/Sprite") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("Unlit/Transparent") as Shader);
|
||||
gameObject.renderer.material = new Material(Shader.Find("QO/Sprite") as Shader);
|
||||
gameObject.name = name;
|
||||
gameObject.transform.parent = parent;
|
||||
return new ImageObject2(gameObject, x, y, z, uniTex);
|
||||
|
||||
@@ -34,6 +34,7 @@ public class LogoMovieWindow : BaseWindow
|
||||
{
|
||||
//TODO fix movie playing. either make platform specific versions OR make platform agnostic
|
||||
//yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/normal/quinrose_logo_8.mp4", FullScreenMovieControlMode.CancelOnInput));
|
||||
yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/normal/quinrose_logo_8.mp4", ""));
|
||||
this.state = LogoMovieWindow.STATE.END;
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public class Man2D : Singleton<Man2D>
|
||||
{
|
||||
this.m_Sprite.Enable();
|
||||
//TODO determine why camera breaks
|
||||
//base.camera.enabled = true;
|
||||
base.camera.enabled = false;
|
||||
base.camera.enabled = true;
|
||||
//base.camera.enabled = false;
|
||||
}
|
||||
|
||||
// Token: 0x06000978 RID: 2424 RVA: 0x00029EF4 File Offset: 0x000280F4
|
||||
|
||||
@@ -6,13 +6,20 @@ using UnityEngine;
|
||||
public class MovieManager
|
||||
{
|
||||
//TODO fix movie playing. either make platform specific versions OR make platform agnostic
|
||||
/*
|
||||
|
||||
// Token: 0x06000ACD RID: 2765 RVA: 0x0002F630 File Offset: 0x0002D830
|
||||
public static IEnumerator PlayMovie(string path, FullScreenMovieControlMode mode)
|
||||
/*public static IEnumerator PlayMovie(string path, FullScreenMovieControlMode mode)
|
||||
{
|
||||
Handheld.PlayFullScreenMovie(path, Color.black, mode);
|
||||
yield return 0;
|
||||
yield break;
|
||||
}*/
|
||||
|
||||
public static IEnumerator PlayMovie(string path, string mode)
|
||||
{
|
||||
//Handheld.PlayFullScreenMovie(path, Color.black, mode);
|
||||
yield return 0;
|
||||
yield break;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ public static class Pathing
|
||||
// Token: 0x06000A8C RID: 2700 RVA: 0x0002E874 File Offset: 0x0002CA74
|
||||
public static string ToPlatformAssetBundleName(string fileName)
|
||||
{
|
||||
return fileName + Pathing.EXTENSION_ASSETBUNDLE_IOS;
|
||||
return fileName;
|
||||
//return fileName + Pathing.EXTENSION_ASSETBUNDLE_IOS;
|
||||
}
|
||||
|
||||
// Token: 0x06000A8D RID: 2701 RVA: 0x0002E890 File Offset: 0x0002CA90
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Qoo.Graphics
|
||||
Debug.Print(string.Format("INFO:Start Movie({0} Skip={1})", text, IsSkip.ToString()));
|
||||
//TODO fix movie playing. either make platform specific versions OR make platform agnostic
|
||||
//UnityTask.SetSubTask(MovieManager.PlayMovie(text, FullScreenMovieControlMode.CancelOnInput));
|
||||
UnityTask.SetSubTask(MovieManager.PlayMovie(text, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,7 +490,6 @@ namespace Qoo.Ks
|
||||
}
|
||||
|
||||
// Token: 0x06000384 RID: 900 RVA: 0x0000BECC File Offset: 0x0000A0CC
|
||||
// TODO investigate for message printing
|
||||
private EVENTSCENE SceneApplySub(EVENTSCENE Scene, bool bMsg, bool IsVoice = true)
|
||||
{
|
||||
if (Scene.Message.Sw == SWITCH.ON && Scene.Message.Tag != null)
|
||||
|
||||
@@ -10,6 +10,7 @@ public class ScreenMovieSample : MonoBehaviour
|
||||
{
|
||||
//TODO fix movie playing. either make platform specific versions OR make platform agnostic
|
||||
//yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/high/op_movie.mp4", FullScreenMovieControlMode.CancelOnInput));
|
||||
yield return base.StartCoroutine(MovieManager.PlayMovie("mp4/high/op_movie.mp4", ""));
|
||||
Debug.Log(" #DEBUGLOG::MOVIE OWATA ");
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -10,10 +10,6 @@ public class UIActionButton : UIAction
|
||||
UIActionButton uiactionButton = go.AddComponent<UIActionButton>();
|
||||
uiactionButton.m_NormalIndex = normal;
|
||||
uiactionButton.m_PressIndex = press;
|
||||
// TODO determine why game isn't handling texture offset correctly
|
||||
// below is a temp fix
|
||||
go.renderer.material.SetTextureOffset ("_MainTex",new Vector2(0f,.5f));
|
||||
go.renderer.material.SetTextureScale ("_MainTex",new Vector2(1f,.5f));
|
||||
|
||||
return uiactionButton;
|
||||
}
|
||||
@@ -37,10 +33,6 @@ public class UIActionButton : UIAction
|
||||
// Token: 0x06000BFA RID: 3066 RVA: 0x000321D4 File Offset: 0x000303D4
|
||||
private void OnMouseDown()
|
||||
{
|
||||
// TODO determine why game isn't handling texture offset correctly
|
||||
// below is a temp fix
|
||||
this.gameObject.renderer.material.SetTextureOffset ("_MainTex",new Vector2(0f,0f));
|
||||
this.gameObject.renderer.material.SetTextureScale ("_MainTex",new Vector2(1f,.5f));
|
||||
|
||||
this.SetImageIndex(this.m_PressIndex);
|
||||
}
|
||||
@@ -48,10 +40,6 @@ public class UIActionButton : UIAction
|
||||
// Token: 0x06000BFB RID: 3067 RVA: 0x000321E4 File Offset: 0x000303E4
|
||||
private void OnMouseUp()
|
||||
{
|
||||
//TODO determine why game isn't handling texture offset correctly
|
||||
// below is a temp fix
|
||||
this.gameObject.renderer.material.SetTextureOffset ("_MainTex",new Vector2(0f,.5f));
|
||||
this.gameObject.renderer.material.SetTextureScale ("_MainTex",new Vector2(1f,.5f));
|
||||
|
||||
this.SetImageIndex(this.m_NormalIndex);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class UnityFile
|
||||
{
|
||||
loader = new WWW(path);
|
||||
yield return loader;
|
||||
this.m_szErrorMsg = loader.error;
|
||||
/*this.m_szErrorMsg = loader.error;
|
||||
if (this.m_szErrorMsg != null && this.m_szErrorMsg.Length > 0)
|
||||
{
|
||||
Qoo.Debug.Print("Error:" + this.m_szErrorMsg);
|
||||
@@ -175,7 +175,8 @@ public class UnityFile
|
||||
else if (loader.isDone)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
break;
|
||||
yield return 0;
|
||||
}
|
||||
if (loader.isDone)
|
||||
@@ -186,23 +187,9 @@ public class UnityFile
|
||||
}
|
||||
else if (this.m_IsAssetBandle)
|
||||
{
|
||||
|
||||
//TODO fix issue with resources ang streaming assets folders and the build
|
||||
//New code start. This loads PNGs directly rather than from assetbundles
|
||||
UnityEngine.Debug.Log (Application.dataPath + "/Resources" + m_szPath + m_szName + ".png");
|
||||
byte[] data = System.IO.File.ReadAllBytes(Application.dataPath + "/Resources" + m_szPath + m_szName + ".png");
|
||||
UnityEngine.Debug.Log (Application.streamingAssetsPath + m_szPath + m_szName + ".png");
|
||||
byte[] data = System.IO.File.ReadAllBytes(Application.streamingAssetsPath + m_szPath + m_szName + ".png");
|
||||
this.m_ReadData = data;
|
||||
//New code end
|
||||
|
||||
//Old code for asset bundles
|
||||
/*
|
||||
AssetBundle ab = loader.assetBundle;
|
||||
TextAsset ta = ab.mainAsset as TextAsset;
|
||||
this.m_ReadData = data;
|
||||
this.m_ReadData = ta.bytes;
|
||||
Resources.UnloadAsset(ta);
|
||||
ab.Unload(false);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -278,23 +278,23 @@ public class UnityGraph : Singleton<UnityGraph>
|
||||
public IEnumerator Effect(string name, float time = 1f)
|
||||
{
|
||||
//TODO effect movies crash game and standard effects need shaders. Fix and re-add them
|
||||
/*
|
||||
|
||||
string text = name;
|
||||
switch (text)
|
||||
{
|
||||
switch (text) {
|
||||
case "FadeIn":
|
||||
this.m_isRunEffect = false;
|
||||
return this.Fade_In((int)(time * 1000f));
|
||||
return this.Fade_In ((int)(time * 1000f));
|
||||
case "FadeOut":
|
||||
this.m_isRunEffect = false;
|
||||
return this.Fade_Out((int)(time * 1000f));
|
||||
return this.Fade_Out ((int)(time * 1000f));
|
||||
case "wave":
|
||||
return this.EffectMain(name, time);
|
||||
return this.EffectMain (name, time);
|
||||
case "ripple":
|
||||
return this.EffectMain(name, time);
|
||||
return this.EffectMain (name, time);
|
||||
case "mosaic":
|
||||
return this.EffectMain(name, time);
|
||||
return this.EffectMain (name, time);
|
||||
}
|
||||
|
||||
if (name == null || name.Length <= 0)
|
||||
{
|
||||
return this.CrossFade(time);
|
||||
@@ -305,6 +305,7 @@ public class UnityGraph : Singleton<UnityGraph>
|
||||
name = imageDir + name;
|
||||
return this.EffectMain(name, time);
|
||||
}
|
||||
return this.CrossFade(time);
|
||||
NMB_FILEINFO fileInfo = Nmb.GetFileInfo(name);
|
||||
if (fileInfo == null)
|
||||
{
|
||||
@@ -315,13 +316,12 @@ public class UnityGraph : Singleton<UnityGraph>
|
||||
name = fileInfo.DirName + fileInfo.FileName;
|
||||
}
|
||||
return this.EffectMovie(name);
|
||||
*/
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Token: 0x060009C0 RID: 2496 RVA: 0x0002B524 File Offset: 0x00029724
|
||||
private IEnumerator EffectMain(string name, float time)
|
||||
protected IEnumerator EffectMain(string name, float time)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning ("NAME: " + name);
|
||||
|
||||
yield return 0;
|
||||
yield return 0;
|
||||
@@ -371,7 +371,7 @@ public class UnityGraph : Singleton<UnityGraph>
|
||||
// Token: 0x060009C2 RID: 2498 RVA: 0x0002B588 File Offset: 0x00029788
|
||||
private IEnumerator CrossFade(float time)
|
||||
{
|
||||
int ms = (int)(time * 1000f);
|
||||
/*int ms = (int)(time * 1000f);
|
||||
this.m_isRunEffect = true;
|
||||
yield return 0;
|
||||
yield return 0;
|
||||
@@ -415,7 +415,7 @@ public class UnityGraph : Singleton<UnityGraph>
|
||||
this.m_FrameDraw.A = byte.MaxValue;
|
||||
this.m_ManSprite.enabled = true;
|
||||
this.m_isRunEffect = false;
|
||||
yield return 0;
|
||||
yield return 0;*/
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,14 +223,7 @@ public class UnitySprite
|
||||
public void SetMaterial(string shader_name)
|
||||
{
|
||||
this.DeleteMaterial();
|
||||
//TODO get all shaders working or implement workarounds
|
||||
//added workaround
|
||||
if (shader_name == "Shader/Sprite/Sprite") {
|
||||
this.obj.renderer.material = new Material (Shader.Find ("Unlit/Transparent") as Shader);
|
||||
} else {
|
||||
this.obj.renderer.material = new Material(Resources.Load(shader_name) as Shader);
|
||||
}
|
||||
//this.obj.renderer.material = new Material(Resources.Load(shader_name) as Shader);
|
||||
this.obj.renderer.material = new Material(Resources.Load(shader_name) as Shader);
|
||||
}
|
||||
|
||||
// Token: 0x060009DE RID: 2526 RVA: 0x0002B940 File Offset: 0x00029B40
|
||||
|
||||
Reference in New Issue
Block a user