void WarpToParent(GameObject obj) { obj.transform.position = parentObj.transform.position + parentObj.transform.up * 0.001f; obj.transform.rotation = parentObj.transform.rotation; obj.GetComponent <Rigidbody>().velocity = Vector3.zero; iCC = obj.GetComponent(typeof(ICharactorController)) as ICharactorController; if (iCC != null) { iCC.Warp(); } iCamera.Warp(); }
public void RegCharactorController(ICharactorController c) { if (cc.ContainsKey(c.idCare) == false) { cc[c.idCare] = c; c.OnInit(this); } else { throw new Exception("CC 只能注册一次"); } }
public void WarpToHome() { targetObj.transform.position = homeObj.transform.position + homeObj.transform.up * 0.001f; targetObj.transform.rotation = homeObj.transform.rotation; targetObj.GetComponent <Rigidbody>().velocity = Vector3.zero; iCC = targetObj.GetComponent(typeof(ICharactorController)) as ICharactorController; if (iCC != null) { iCC.Warp(); } iCamera.Warp(); }
public ICharactorController GetCharactorController(int id) { ICharactorController c = null; if (cc.TryGetValue(id, out c)) { return(c); } else { return(null); } }