public ThrowPoint IniReadThrowPoint(string section, string key) { ThrowPoint throwPoint = new ThrowPoint(); StringBuilder temp = new StringBuilder(255); string strres, strX, strY, strZ, strD; GetPrivateProfileString(section, key, "", temp, 255, this.Path); strres = temp.ToString(); try { strX = strres.Split(new char[] { ',' })[0]; strY = strres.Split(new char[] { ',' })[1]; strZ = strres.Split(new char[] { ',' })[2]; strD = strres.Split(new char[] { ',' })[3]; throwPoint.X = double.Parse(strX); throwPoint.Y = double.Parse(strY); throwPoint.Z = double.Parse(strZ); throwPoint.Delay_Throw = int.Parse(strD); } catch { //Function.function.PutInLog("读取" + Path + "中参数" + section + ":" + key + "出错", false); return(throwPoint); } return(throwPoint); }
public override void Init(Inventory owner) { base.Init(owner); //если корзина для мусора, то пусть инициализирует точку для выброса и подписывается на функцию. ThrowPoint.Init(); inventory.onItemDisposed = ThrowItem; }
void Start() //What you need when the game start? EVERYTHINGS { levelManager = FindObjectOfType <LevelManager> (); anim = GetComponent <Animator> (); kunaiController = FindObjectOfType <KunaiController> (); throwPoint = FindObjectOfType <ThrowPoint> (); myrigidbody2D = GetComponent <Rigidbody2D> (); }
public void IniWriteThrowPoint(string section, string key, ThrowPoint throwPoint) { string strX = throwPoint.X.ToString("F3"); string strY = throwPoint.Y.ToString("F3"); string strZ = throwPoint.Z.ToString("F3"); string strD = throwPoint.Delay_Throw.ToString("F3"); WritePrivateProfileString(section, key, strX + "," + strY + "," + strZ + "," + strD, this.Path); }