Files
Slendytubbies-V2-Beta/V2Beta/Assets/Scripts/Assembly-UnityScript/ChangeTextures.cs
T
2026-05-24 12:14:04 +02:00

384 lines
11 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Boo.Lang;
using UnityEngine;
[Serializable]
public class ChangeTextures : MonoBehaviour
{
[Serializable]
internal sealed class _0024LoadCL_002415 : GenericGenerator<WWW>
{
[Serializable]
internal sealed class _0024 : GenericGeneratorEnumerator<WWW>, IEnumerator
{
internal GameObject _0024GOH_002416;
internal GameObject _0024GOH1_002417;
internal string _0024urlTT_002418;
internal WWW _0024downloadTT_002419;
internal GameObject _0024GOH2_002420;
internal string _0024urlTC_002421;
internal WWW _0024downloadTC_002422;
internal GameObject _0024GOH3_002423;
internal string _0024urlTCl_002424;
internal WWW _0024downloadTCl_002425;
internal GameObject _0024GOH4_002426;
internal GameObject _0024GOH45_002427;
internal GameObject _0024GOH46_002428;
internal string _0024urlTCA_002429;
internal WWW _0024downloadTCA_002430;
internal GameObject _0024GOH5_002431;
internal GameObject _0024GOH55_002432;
internal string _0024urlTCB_002433;
internal WWW _0024downloadTCB_002434;
internal string _0024ent_002435;
internal string _0024tT_002436;
internal string _0024tC_002437;
internal string _0024tCl_002438;
internal string _0024tCA_002439;
internal string _0024tCB_002440;
internal ChangeTextures _0024self__002441;
public _0024(string ent, string tT, string tC, string tCl, string tCA, string tCB, ChangeTextures self_)
{
_0024ent_002435 = ent;
_0024tT_002436 = tT;
_0024tC_002437 = tC;
_0024tCl_002438 = tCl;
_0024tCA_002439 = tCA;
_0024tCB_002440 = tCB;
_0024self__002441 = self_;
}
public override bool MoveNext()
{
int result;
switch (_state)
{
default:
if (_0024self__002441.gameObject.GetComponent<NetworkView>().viewID.ToString().Remove(0, 13) == _0024ent_002435)
{
_0024GOH_002416 = GameObject.Find("multiplayertubby/default" + _0024ent_002435);
_0024GOH1_002417 = GameObject.Find("multiplayertubby/headmesh" + _0024ent_002435);
_0024urlTT_002418 = _0024tT_002436;
_0024downloadTT_002419 = new WWW(_0024urlTT_002418);
result = (Yield(2, _0024downloadTT_002419) ? 1 : 0);
break;
}
goto IL_038e;
case 2:
_0024GOH_002416.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTT_002419.texture;
_0024GOH1_002417.GetComponent<Renderer>().materials[1].mainTexture = _0024downloadTT_002419.texture;
_0024GOH1_002417.GetComponent<Renderer>().materials[2].mainTexture = _0024downloadTT_002419.texture;
_0024GOH2_002420 = GameObject.Find("multiplayertubby/headmesh" + _0024ent_002435);
_0024urlTC_002421 = _0024tC_002437;
_0024downloadTC_002422 = new WWW(_0024urlTC_002421);
result = (Yield(3, _0024downloadTC_002422) ? 1 : 0);
break;
case 3:
_0024GOH2_002420.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTC_002422.texture;
_0024GOH3_002423 = GameObject.Find("multiplayertubby/Cylinder002" + _0024ent_002435);
_0024urlTCl_002424 = _0024tCl_002438;
_0024downloadTCl_002425 = new WWW(_0024urlTCl_002424);
result = (Yield(4, _0024downloadTCl_002425) ? 1 : 0);
break;
case 4:
_0024GOH3_002423.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTCl_002425.texture;
_0024GOH4_002426 = GameObject.Find("multiplayertubby/rightarmmesh" + _0024ent_002435);
_0024GOH45_002427 = GameObject.Find("multiplayertubby/leftarmmesh" + _0024ent_002435);
_0024GOH46_002428 = GameObject.Find("multiplayertubby/headmesh" + _0024ent_002435);
_0024urlTCA_002429 = _0024tCA_002439;
_0024downloadTCA_002430 = new WWW(_0024urlTCA_002429);
result = (Yield(5, _0024downloadTCA_002430) ? 1 : 0);
break;
case 5:
_0024GOH4_002426.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTCA_002430.texture;
_0024GOH45_002427.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTCA_002430.texture;
_0024GOH46_002428.GetComponent<Renderer>().materials[2].mainTexture = _0024downloadTCA_002430.texture;
_0024GOH5_002431 = GameObject.Find("multiplayertubby/rightlegmesh" + _0024ent_002435);
_0024GOH55_002432 = GameObject.Find("multiplayertubby/leftlegmesh" + _0024ent_002435);
_0024urlTCB_002433 = _0024tCB_002440;
_0024downloadTCB_002434 = new WWW(_0024urlTCB_002433);
result = (Yield(6, _0024downloadTCB_002434) ? 1 : 0);
break;
case 6:
_0024GOH5_002431.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTCB_002434.texture;
_0024GOH55_002432.GetComponent<Renderer>().materials[0].mainTexture = _0024downloadTCB_002434.texture;
goto IL_038e;
case 1:
{
result = 0;
break;
}
IL_038e:
YieldDefault(1);
goto case 1;
}
return (byte)result != 0;
}
}
internal string _0024ent_002442;
internal string _0024tT_002443;
internal string _0024tC_002444;
internal string _0024tCl_002445;
internal string _0024tCA_002446;
internal string _0024tCB_002447;
internal ChangeTextures _0024self__002448;
public _0024LoadCL_002415(string ent, string tT, string tC, string tCl, string tCA, string tCB, ChangeTextures self_)
{
_0024ent_002442 = ent;
_0024tT_002443 = tT;
_0024tC_002444 = tC;
_0024tCl_002445 = tCl;
_0024tCA_002446 = tCA;
_0024tCB_002447 = tCB;
_0024self__002448 = self_;
}
public override IEnumerator<WWW> GetEnumerator()
{
return new _0024(_0024ent_002442, _0024tT_002443, _0024tC_002444, _0024tCl_002445, _0024tCA_002446, _0024tCB_002447, _0024self__002448);
}
}
public string entID;
public int OneTime;
public bool renderize;
public Rect windowRect;
public bool hidedWindow;
public string addTextureBodyI;
public string addTextureHeadI;
public string addTextureHatI;
public string addTextureArmsI;
public string addTextureLegsI;
public string addTextureBody;
public string addTextureHead;
public string addTextureHat;
public string addTextureArms;
public string addTextureLegs;
public string titBut;
public ChangeTextures()
{
windowRect = new Rect(20f, 30f, 350f, 300f);
hidedWindow = true;
addTextureBodyI = "http://i48.tinypic.com/2eckyyq.png";
addTextureHeadI = "http://i50.tinypic.com/eppws5.png";
addTextureHatI = "http://i46.tinypic.com/28uoiz9.jpg";
addTextureArmsI = "http://i48.tinypic.com/2eckyyq.png";
addTextureLegsI = "http://i48.tinypic.com/2eckyyq.png";
addTextureBody = " ";
addTextureHead = " ";
addTextureHat = " ";
addTextureArms = " ";
addTextureLegs = " ";
titBut = "Accept/confirm";
}
public virtual void Start()
{
entID = gameObject.GetComponent<NetworkView>().viewID.ToString().Remove(0, 13);
}
public virtual void showWindow()
{
renderize = true;
}
public virtual void hideWindow()
{
renderize = false;
}
public virtual void OnGUI()
{
GUI.depth = 1;
if (OneTime == 0 && GetComponent<NetworkView>().isMine && GUI.Button(new Rect(10f, Screen.height - 30, 135f, 20f), titBut))
{
if (hidedWindow)
{
showWindow();
hidedWindow = false;
}
else
{
hideWindow();
hidedWindow = true;
Load();
OneTime = 1;
}
}
if (renderize)
{
windowRect = GUI.Window(1, windowRect, window1, "Character Customization");
}
}
public virtual void window1(int windowID)
{
GUI.DragWindow(new Rect(0f, 0f, 120f, 20f));
GUI.Label(new Rect(10f, 25f, 300f, 20f), "Body/Torso texture");
if (GUI.Button(new Rect(50f, 50f, 50f, 20f), "Red"))
{
addTextureBodyI = "http://i45.tinypic.com/2ed77sm.png";
}
if (GUI.Button(new Rect(100f, 50f, 60f, 20f), "Purple"))
{
addTextureBodyI = "http://i50.tinypic.com/2v927ue.png";
}
if (GUI.Button(new Rect(160f, 50f, 60f, 20f), "Green"))
{
addTextureBodyI = "http://i47.tinypic.com/30de0w7.png";
}
if (GUI.Button(new Rect(220f, 50f, 60f, 20f), "Yellow"))
{
addTextureBodyI = "http://i48.tinypic.com/1zdi51.png";
}
if (GUI.Button(new Rect(280f, 50f, 60f, 20f), "White"))
{
addTextureBodyI = "http://i48.tinypic.com/2eckyyq.png ";
}
addTextureBodyI = GUI.TextField(new Rect(10f, 70f, 330f, 20f), addTextureBodyI);
GUI.Label(new Rect(10f, 95f, 400f, 20f), "Head texture");
if (GUI.Button(new Rect(50f, 120f, 50f, 20f), "Red"))
{
addTextureHeadI = "http://i48.tinypic.com/oibk8.png";
}
if (GUI.Button(new Rect(100f, 120f, 60f, 20f), "Purple"))
{
addTextureHeadI = "http://i47.tinypic.com/sgsnl3.png";
}
if (GUI.Button(new Rect(160f, 120f, 60f, 20f), "Green"))
{
addTextureHeadI = "http://i46.tinypic.com/2l95q9.png";
}
if (GUI.Button(new Rect(220f, 120f, 60f, 20f), "Yellow"))
{
addTextureHeadI = "http://i45.tinypic.com/2qc1oxk.png";
}
if (GUI.Button(new Rect(280f, 120f, 60f, 20f), "White"))
{
addTextureHeadI = "http://i50.tinypic.com/eppws5.png";
}
addTextureHeadI = GUI.TextField(new Rect(10f, 140f, 330f, 20f), addTextureHeadI);
GUI.Label(new Rect(10f, 165f, 400f, 20f), "Hat texture");
addTextureHatI = GUI.TextField(new Rect(10f, 190f, 330f, 20f), addTextureHatI);
GUI.Label(new Rect(10f, 215f, 400f, 20f), "Arms texture");
if (GUI.Button(new Rect(50f, 240f, 50f, 20f), "Red"))
{
addTextureArmsI = "http://i45.tinypic.com/2ed77sm.png";
}
if (GUI.Button(new Rect(100f, 240f, 60f, 20f), "Purple"))
{
addTextureArmsI = "http://i50.tinypic.com/2v927ue.png";
}
if (GUI.Button(new Rect(160f, 240f, 60f, 20f), "Green"))
{
addTextureArmsI = "http://i47.tinypic.com/30de0w7.png";
}
if (GUI.Button(new Rect(220f, 240f, 60f, 20f), "Yellow"))
{
addTextureArmsI = "http://i48.tinypic.com/1zdi51.png";
}
if (GUI.Button(new Rect(280f, 240f, 60f, 20f), "White"))
{
addTextureArmsI = "http://i48.tinypic.com/2eckyyq.png";
}
addTextureArmsI = GUI.TextField(new Rect(10f, 260f, 330f, 20f), addTextureArmsI);
GUI.Label(new Rect(10f, 285f, 400f, 20f), "Legs texture");
if (GUI.Button(new Rect(50f, 310f, 50f, 20f), "Red"))
{
addTextureLegsI = "http://i45.tinypic.com/2ed77sm.png";
}
if (GUI.Button(new Rect(100f, 310f, 60f, 20f), "Purple"))
{
addTextureLegsI = "http://i50.tinypic.com/2v927ue.png";
}
if (GUI.Button(new Rect(160f, 310f, 60f, 20f), "Green"))
{
addTextureLegsI = "http://i47.tinypic.com/30de0w7.png";
}
if (GUI.Button(new Rect(220f, 310f, 60f, 20f), "Yellow"))
{
addTextureLegsI = "http://i48.tinypic.com/1zdi51.png";
}
if (GUI.Button(new Rect(280f, 310f, 60f, 20f), "White"))
{
addTextureLegsI = "http://i48.tinypic.com/2eckyyq.png";
}
addTextureLegsI = GUI.TextField(new Rect(10f, 330f, 330f, 20f), addTextureLegsI);
}
public virtual void Load()
{
addTextureBody = addTextureBodyI;
addTextureHead = addTextureHeadI;
addTextureHat = addTextureHatI;
addTextureArms = addTextureArmsI;
addTextureLegs = addTextureLegsI;
if (GetComponent<NetworkView>().isMine)
{
GetComponent<NetworkView>().RPC("LoadCL", RPCMode.AllBuffered, entID, addTextureBody, addTextureHead, addTextureHat, addTextureArms, addTextureLegs);
}
}
[RPC]
public virtual IEnumerator LoadCL(string ent, string tT, string tC, string tCl, string tCA, string tCB)
{
return new _0024LoadCL_002415(ent, tT, tC, tCl, tCA, tCB, this).GetEnumerator();
}
public virtual void Main()
{
}
}