SHARE
TWEET

FF9::Shadows

MaKiPL Apr 20th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void ff9battleShadowInit(int shadowCount)
  2.     {
  3.         GameObject[] array = FF9StateSystem.Battle.FF9Battle.map.shadowArray = new GameObject[shadowCount];
  4.         for (int i = 0; i < shadowCount; i++)
  5.         {
  6.             List<Vector3> list = new List<Vector3>();
  7.             List<Color> list2 = new List<Color>();
  8.             List<Vector2> list3 = new List<Vector2>();
  9.             List<int> list4 = new List<int>();
  10.             list.Add(new Vector3(-1f, 0f, -1f));
  11.             list.Add(new Vector3(1f, 0f, -1f));
  12.             list.Add(new Vector3(1f, 0f, 1f));
  13.             list.Add(new Vector3(-1f, 0f, 1f));
  14.             Color item = new Color(1f, 1f, 1f, 0.6f);
  15.             list2.Add(item);
  16.             list2.Add(item);
  17.             list2.Add(item);
  18.             list2.Add(item);
  19.             list3.Add(new Vector2(0f, 0f));
  20.             list3.Add(new Vector2(1f, 0f));
  21.             list3.Add(new Vector2(1f, 1f));
  22.             list3.Add(new Vector2(0f, 1f));
  23.             list4.Add(2);
  24.             list4.Add(1);
  25.             list4.Add(0);
  26.             list4.Add(3);
  27.             list4.Add(2);
  28.             list4.Add(0);
  29.             Mesh mesh = new Mesh();
  30.             mesh.vertices = list.ToArray();
  31.             mesh.colors = list2.ToArray();
  32.             mesh.uv = list3.ToArray();
  33.             mesh.triangles = list4.ToArray();
  34.             GameObject gameObject = array[i] = new GameObject("shadow" + i.ToString("D3"));
  35.             gameObject.transform.localScale = new Vector3(224f, 0f, 192f);
  36.             MeshRenderer meshRenderer = gameObject.AddComponent<MeshRenderer>();
  37.             MeshFilter meshFilter = gameObject.AddComponent<MeshFilter>();
  38.             meshFilter.mesh = mesh;
  39.             Shader shadowShader = FF9StateSystem.Battle.shadowShader;
  40.             Material material = new Material(shadowShader);
  41.             material.SetColor("_TintColor", new Color32(64, 64, 64, 255));
  42.             material.mainTexture = AssetManager.Load<Texture2D>("CommonAsset/Common/shadow_plate", false);
  43.             meshRenderer.material = material;
  44.             gameObject.SetActive(false);
  45.         }
  46.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top