Commit 43cb69e0 authored by mercury233's avatar mercury233 Committed by Unicorn369

delete old codes

parent ffb143dc
......@@ -1098,4 +1098,13 @@ public static class UIHelper
foreach (Transform achild in Transforms)
achild.gameObject.layer = parent.layer;
}
internal static Vector3 get_close(Vector3 input_vector, Camera cam, float l)
{
Vector3 o = Vector3.zero;
Vector3 scr = cam.WorldToScreenPoint(input_vector);
scr.z -= l;
o = cam.ScreenToWorldPoint(scr);
return o;
}
}
......@@ -2541,7 +2541,7 @@ public class gameCard : OCGobject
if (ballChain!=null)
{
del_all_decoration_by_string("chaining");
Vector3 pos = ui_helper.get_close(gameObject.transform.position, Program.camera_game_main, 5);
Vector3 pos = UIHelper.get_close(gameObject.transform.position, Program.camera_game_main, 5);
if (Program.I().setting.setting.Vchain.value == true)
{
MonoBehaviour.Destroy((GameObject)MonoBehaviour.Instantiate(Program.I().mod_ocgcore_cs_end, pos, Quaternion.identity), 5f);
......
......@@ -4923,7 +4923,7 @@ public class Ocgcore : ServantWithCardDescription
UIHelper.playSound("addcounter", 1);
//if (Program.YGOPro1 == false)
{
Vector3 pos = ui_helper.get_close(card.gameObject.transform.position, Program.camera_game_main, 5);
Vector3 pos = UIHelper.get_close(card.gameObject.transform.position, Program.camera_game_main, 5);
MonoBehaviour.Destroy((GameObject)MonoBehaviour.Instantiate(Program.I().mod_ocgcore_cs_end, pos, Quaternion.identity), 5f);
}
}
......@@ -4944,7 +4944,7 @@ public class Ocgcore : ServantWithCardDescription
UIHelper.playSound("removecounter", 1);
//if (Program.YGOPro1 == false)
{
Vector3 pos = ui_helper.get_close(card.gameObject.transform.position, Program.camera_game_main, 5);
Vector3 pos = UIHelper.get_close(card.gameObject.transform.position, Program.camera_game_main, 5);
MonoBehaviour.Destroy((GameObject)MonoBehaviour.Instantiate(Program.I().mod_ocgcore_cs_end, pos, Quaternion.identity), 5f);
}
}
......
......@@ -655,7 +655,7 @@ public class Servant
sp.width = 470;
for (int i = 0; i < options.Count; i++)
{
Vector2 v = ui_helper.get_hang_lie(i, 5);
Vector2 v = UIHelper.get_hang_lie(i, 5);
float hang = v.x;
float lie = v.y;
GameObject btn = create
......
fileFormatVersion: 2
guid: f52930133f54dd446bd23d432f0b4332
folderAsset: yes
timeCreated: 1469182564
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//using UnityEngine;
//using System.Collections;
//public class Delegater : MonoBehaviour
//{
// public CLIENT_SERVANT_OCGCORE.refresh_function f;
// // Use this for initialization
// void Start () {
// }
// public void function()
// {
// if (f != null) f();
// }
// // Update is called once per frame
// void Update () {
// }
//}
fileFormatVersion: 2
guid: e0685e730c8d7864e92f6cca605c4f52
timeCreated: 1480605664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.IO;
class TXT_DEBUGER_ruined
{
public static void debug(string raw)
{
FileStream fs = new FileStream("log.txt", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(raw + "\n");
sw.Flush();
sw.Close();
fs.Close();
}
}
fileFormatVersion: 2
guid: 1d455ff0e7866fd44abf7aca88d2ffbc
timeCreated: 1470044743
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: c348bd288e8db2d4d8ea0455b2c6a2e1
timeCreated: 1480605661
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 89103720b5148e84a8ebeb6a8372af4a
timeCreated: 1480605654
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 7c2075ecc16bdb54b917575d16794398
timeCreated: 1480605653
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using UnityEngine;
public class string_reader
{
class string_hash
{
public string father = "";
public int id = 0;
public string content = "";
}
List<string_hash> strs = new List<string_hash>();
public int get_int(string str)
{
int return_value = 0;
if(str.Length>2&&str.Substring(0,2)=="0x"){
return_value = Convert.ToInt32(str,16);
}
else
{
return_value = Int32.Parse(str);
}
return return_value;
}
public string_reader(string path)
{
string text = System.IO.File.ReadAllText(path);
string st = text.Replace("\r", "");
string[] lines = st.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
foreach (string line in lines)
{
if (line.Length>1&&line.Substring(0,1)=="!")
{
string[] mats = line.Substring(1, line.Length-1).Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (mats.Length > 2)
{
string_hash a = new string_hash();
a.father = mats[0];
try
{
a.id = get_int(mats[1]);
}catch(Exception e){
Debug.Log(e);
}
a.content = mats[2];
strs.Add(a);
if (a.id==1160)
{
Debug.Log(a.content);
}
}
}
}
}
public string get(string father,int id)
{
string re = "";
foreach (string_hash s in strs)
{
if(s.father==father&&s.id==id){
re = s.content;
}
}
return re;
}
}
fileFormatVersion: 2
guid: a11211d5ee383a8479ecca7d7e220cdf
timeCreated: 1480605656
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.IO;
using UnityEngine;
public class ui_helper
{
public static Vector2 get_hang_lie(int index, int meihangdegeshu)
{
Vector2 return_value = Vector2.zero;
return_value.x = (int)index / meihangdegeshu;
return_value.y = index % meihangdegeshu;
return return_value;
}
public static int get_zuihouyihangdegeshu(int zongshu,int meihangdegeshu)
{
int re = 0;
re = zongshu % meihangdegeshu;
if (re==0)
{
re = meihangdegeshu;
}
return re;
}
public static bool get_shifouzaizuihouyihang(int zongshu, int meihangdegeshu,int index)
{
return (int)((index) / meihangdegeshu) == (int)(zongshu / meihangdegeshu);
}
public static int get_zonghangshu(int zongshu, int meihangdegeshu)
{
return ((int)(zongshu - 1) / meihangdegeshu) + 1;
}
public static Vector3 get_close(Vector3 input_vector,Camera cam,float l)
{
Vector3 o = Vector3.zero;
Vector3 scr = cam.WorldToScreenPoint(input_vector);
scr.z -= l;
o = cam.ScreenToWorldPoint(scr);
return o;
}
public static Texture2D get_rand_face()
{
DirectoryInfo TheFolder = new DirectoryInfo("face");
FileInfo[] fileInfo = TheFolder.GetFiles();
FileInfo NextFile;
Texture2D tex = new Texture2D(400, 600);
if (fileInfo.Length > 0)
{
NextFile = fileInfo[UnityEngine.Random.Range(0, fileInfo.Length)];
byte[] data;
using (FileStream file = new FileStream(NextFile.FullName, FileMode.Open, FileAccess.Read))
{
file.Seek(0, SeekOrigin.Begin);
data = new byte[file.Length];
file.Read(data, 0, (int)file.Length);
}
tex.LoadImage(data);
}
return tex;
}
}
fileFormatVersion: 2
guid: d53d6189fd0c71342a84342e7dc83c27
timeCreated: 1480605664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment