void Reset(GameObject obj) { obj.transform.SetParent(GameObject.Find("System/GamePoor").transform); obj.name = prosid + "/" + stuck.Count; Self_class temp = obj.GetComponent <Self_class>(); Self_class pre = InitObj.GetComponent <Self_class>(); temp.p_life = pre.p_life; }
public static void SubAtribute(GameObject obj, GameObject Aobj) { Self_class atc = Aobj.GetComponent <Self_class>(); Self_class otc = obj.GetComponent <Self_class>(); atc.s_AttackValue -= otc.s_AttackValue; atc.s_Defence -= otc.s_Defence; atc.s_GatherValue -= otc.s_GatherValue; atc.s_life -= otc.s_life; atc.s_speed -= otc.s_speed; }
void GetData() { Self_class sc = cplayer.GetComponent <Self_class>(); speed = sc.s_speed; defense = sc.s_Defence; attack = sc.s_AttackValue; scout = sc.s_Scout; slife = sc.s_life; hunger = sc.s_Hunger; hungerspeed = sc.s_HungerSpeed; gather = sc.s_GatherValue; freetalent = sc.TalentFreePoint; sname = sc.s_name; Transform TimeTram = GameObject.Find("System").transform.FindChild("TIme"); int _time = TimeTram.GetComponent <TimeTram>().Time; int _day = TimeTram.GetComponent <TimeTram>().Day; scout += 0.1f * (_day * 14400 + _time - 32f); }