using UnityEngine; using System.Globalization; using UnityEngine.UI; using System.Collections.Generic; public class DOBS : MonoBehaviour { public static void SplashL(GameObject BASE, string C, float W, float H,float D, string CT) { string[] SC = C.Split(","[0]); float OL = DOIT.ConvertStringToNumber(SC[0]); float OT = DOIT.ConvertStringToNumber(SC[1]); //float OR = DOIT.ConvertStringToNumber(SC[2]); float OB = DOIT.ConvertStringToNumber(SC[3]); //float t = 0.625f; if (C != "0,0,0,0") { //string Name, float sx, float sy, float sz, float px, float py, float pz, float rx, float ry, float rz, string texscode //GameObject SPBL = Createmcx.Mcx("SPBL", W + OL, H + OT + OB, t, -W / 2 + t / 2, -H / 2 + (H + OT - OB) / 2, -OL / 2, 0, -90, 0, CT); GameObject SPBL = Createmcx.Mcx("SPBL", D + OL, H + OT + OB, 0.25f, -W *0.5f, -H / 2 + (H + OT - OB) / 2, -OL*0.5f, 0, -90, 0, CT); SetObjet(SPBL,BASE); } } public static void SplashC(GameObject BASE, string C, float W, float H, float D, string CT) { //print("stove C[54]===2="+CT); string[] SC = C.Split(","[0]); float OL = DOIT.ConvertStringToNumber(SC[0]); float OT = DOIT.ConvertStringToNumber(SC[1]); float OR = DOIT.ConvertStringToNumber(SC[2]); float OB = DOIT.ConvertStringToNumber(SC[3]); float t = 0.625f; if (C != "0,0,0,0") { GameObject SPB = Createmcx.Mcx("SPB", W + OL + OR, H + OT + OB, 0.25f, OR / 2 - OL / 2, -H / 2 + (H + OT - OB) / 2, D *0.5f, 0, 0, 0, CT); SetObjet(SPB,BASE); } } public static void SplashR(GameObject BASE, string C, float W, float H, float D, string CT) { string[] SC = C.Split(","[0]); //float OL = DOIT.ConvertStringToNumber(SC[0]); float OT = DOIT.ConvertStringToNumber(SC[1]); float OR = DOIT.ConvertStringToNumber(SC[2]); float OB = DOIT.ConvertStringToNumber(SC[3]); //float t = 0.625f; if (C != "0,0,0,0") { GameObject SPBR = Createmcx.Mcx("SPBR", D + OR, H + OT + OB, 0.25f, W *0.5f , -H *0.5f + (H + OT - OB) *0.5f, -OR *0.5f, 0, 90, 0, CT); SetObjet(SPBR,BASE); } } public static void SplashARROWN(GameObject BASE, string C, float w, float h, float d, string CT,float backBox) { print("CT===="+CT);//SPLA.1?F6F6F6?F6F6F6?F6F6F6?1?0?0.5?0.3?1 print("C===="+C);//SPLA.1?F6F6F6?F6F6F6?F6F6F6?1?0?0.5?0.3?1 //CT====SPLA.1?F6F6F6?F6F6F6?F6F6F6?1-1?0?1?0.5?0.3?0 //CT=CT.Replace(",","?"); string[] Recipe = C.Split(","[0]); float OL = DOIT.ConvertStringToNumber(Recipe [0]); float OT = DOIT.ConvertStringToNumber(Recipe [1]); float OR = DOIT.ConvertStringToNumber(Recipe [2]); float OU = DOIT.ConvertStringToNumber(Recipe [3]); //float t = 0.625f; if (C != "0,0,0,0") { GameObject SPL = Createmcx.Mcx("SPL", OL , h, 0.25f, -w/2- OL / 2, 0, backBox, 0, 0, 0, CT); GameObject SPT = Createmcx.Mcx("SPT", w + OL + OR, OT, 0.25f, OR / 2 - OL / 2, h / 2 + OT / 2, backBox, 0, 0, 0, CT); GameObject SPR = Createmcx.Mcx("SPR", OR, h, 0.25f, w/2+OR / 2 , 0,backBox, 0, 0, 0, CT); GameObject SPU = Createmcx.Mcx("SPU", w + OL + OR, OU, 0.25f, OR / 2 - OL / 2, -h / 2 - OU / 2, backBox, 0, 0, 0, CT); SetObjet(SPL,BASE); SetObjet(SPT,BASE); SetObjet(SPR,BASE); SetObjet(SPU,BASE); } } public static void SetObjet(GameObject O,GameObject Parent){ O.GetComponent().probeAnchor = GameObject.Find("Reflection Probe").transform; O.tag = "splash"; O.transform.SetParent(Parent.transform); } }