// Start is called before the first frame update void Start() { SomethingNotMonoButNeedUpdateAndCoroutine not_mono = new SomethingNotMonoButNeedUpdateAndCoroutine(); //MonoMgr.GetInstance().AddUpdateListener(not_mono.Update); MonoMgr.GetInstance().StartCoroutine(not_mono.TellYouThisIsIE()); }
public void RemoveListener() { EventCenter.GetInstance().RemoveEventListener <float>("Loading", GetProgress); EventCenter.GetInstance().RemoveEventListener <Vector2>("GameEndVector2", GameEnd); MonoMgr.GetInstance().RemoveLateUpdateListener(EndGameTimer); EventCenter.GetInstance().RemoveEventListener(EventData.gameReset, WhiteMaskEvent); }
public void PlayAnim() { if (anim == null) { return; } anim.Play(); MonoMgr.GetInstance().AddLateUpdateListener(UpdatedIsPlaying); MonoMgr.GetInstance().AddLateUpdateListener(AnimEndEvent); }
// Start is called before the first frame update void Start() { cc = this.GetComponent <CharacterController>(); MonoMgr.GetInstance().AddUpdateListener(move); point = mouseRay.GetInstance().point; EventCenter.GetInstance().AddEventListener("鼠标按下", () => { move(); }); }
/// <summary> /// 移除监听 /// </summary> public void RemoveListener() { #if UNITY_STANDALONE || UNITY_EDITOR MonoMgr.GetInstance().RemoveUpdateListener(ToPCInput); #endif #if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR MonoMgr.GetInstance().RemoveUpdateListener(ToTouch); #endif MonoMgr.GetInstance().AddLateUpdateListener(UpdatedInput); }
/// <summary> /// 移除监听 /// </summary> public void RemoveListener() { #if UNITY_STANDALONE || UNITY_EDITOR MonoMgr.GetInstance().RemoveUpdateListener(PCTargetActive); #endif #if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR MonoMgr.GetInstance().RemoveUpdateListener(PhoneTargetActive); #endif EventCenter.GetInstance().RemoveEventListener <GameObject>("OnClickAnim", TargetObjOnClickAnimPlay); EventCenter.GetInstance().RemoveEventListener <GameObject>("OnClickBody", TargetObjOnClickBody); EventCenter.GetInstance().RemoveEventListener <GameObject>("TwoOnClickBody", TargetObjTwoOnClickBody); }
private void Start() { //测试ui UIMgr.GetInstance().ShowPanel("LoginPanel", Ui_Type.mid); testtest t = new testtest(); MonoMgr.GetInstance().AddUpdateListener(t.update1); //AudioMgr.GetInstance().PlayBKMusic("0204"); AudioMgr.GetInstance().PlaySound("SwordSwing", false, (o) => { Debug.Log("1256789"); }); }
//出栈 public GameObject PopObj() { GameObject obj; if (pool.Count < 1) { AllNum++; obj = MonoMgr.GetInstance().CopyGameObject(childObj); } else { obj = pool.Pop(); } obj.transform.parent = null; obj.SetActive(true); return(obj); }
void AnimEndEvent() { if (isEvent) { return; } //if (anim == null) return; if (!isPlaying) { if (gameStartEvent != null) { isEvent = true; //Debug.Log("GameStart"); gameStartEvent?.Invoke(null); MonoMgr.GetInstance().RemoveLateUpdateListener(UpdatedIsPlaying); MonoMgr.GetInstance().RemoveLateUpdateListener(AnimEndEvent); } } }
void Start() { GameObject a = new GameObject(); //3.将我们的信息放在一个mesh上 mesh = new Mesh(); mesh.name = "Chunck"; //添加定点信息和面数信息 AddCubeFront(); AddCubeBack(); AddCubeRight(); mesh.SetVertices(vectors.ToArray()); //mesh.vertices = vectors.ToArray(); 直接对mesh.vertices和mesh.triangles进行赋值是老版本的Untiy输入网格数据的方法,这种方式并不准确,因为mesh.triangles里存储的顶点索引信息并不一定是构成三角形, //也可能是Lines,Quad等方式,所以为了区分primitive(图元)的类型,新增了SetIndices函数,用于区别图元的类型。 mesh.triangles = trilos.ToArray(); //4.合成 mesh.RecalculateBounds(); //重新计算包围体 mesh.RecalculateNormals(); //重新计算网格的法线 GetComponent <MeshCollider>().sharedMesh = mesh; GetComponent <MeshFilter>().mesh = mesh; MonoMgr.GetInstance().AddUpdateListener(MyUpdate); }
public override void RemoveListener() { MonoMgr.GetInstance().RemoveUpdateListener(ActivePlayer); MonoMgr.GetInstance().RemoveLateUpdateListener(DownPlayerEvnet); MonoMgr.GetInstance().RemoveFixedUpdateListener(DownColliderEvent); }
/// <summary> /// 构造函数里面添加Update监听 /// </summary> public InputMgr() { MonoMgr.GetInstance().AddUpdateListener(Update); }
private void OnEnable() { MonoMgr.GetInstance().AddUpdateListener(UpdatedResetAix); }
public void LoadSceneAsyn(string name, UnityAction func) { //公共Mono模块 MonoMgr.GetInstance().StartCoroutine(ReallyLoadSceneAsyn(name, func)); }
private void OnDestroy() { MonoMgr.GetInstance().RemoveLateUpdateListener(UpdatedIsPlaying); MonoMgr.GetInstance().RemoveLateUpdateListener(AnimEndEvent); }
public void RemoveListener() { MonoMgr.GetInstance().RemoveUpdateListener(UpdatedMarkAix); }
public override void RemoveListener() { base.RemoveListener(); MonoMgr.GetInstance().RemoveUpdateListener(UpadedSpring); EventCenter.GetInstance().RemoveEventListener("ResetPlayer", GameReset); }
public void AddListener() { MonoMgr.GetInstance().AddUpdateListener(UpdatedMarkAix); }
public void RemoveListener() { MonoMgr.GetInstance().RemoveFixedUpdateListener(ControlRigBounsiness); }
public void AddListener() { MonoMgr.GetInstance().AddFixedUpdateListener(ControlRigBounsiness); }
public void AddListener() { MonoMgr.GetInstance().AddFixedUpdateListener(GravityModifier); }
public void AddListener() { MonoMgr.GetInstance().AddLateUpdateListener(ToActive); }
public void RemoveListener() { MonoMgr.GetInstance().RemoveFixedUpdateListener(GravityModifier); }
public AudioMgr() { MonoMgr.GetInstance().AddUpdateListener(audioUpdate); }
//异步加载资源 public void LoadAsync <T>(string name, UnityAction <T> callback) where T : Object { MonoMgr.GetInstance().StartCoroutine(ReallyLoadAsync <T>(name, callback)); }
public void AddListener() { MonoMgr.GetInstance().AddUpdateListener(UpdatedMusicUI); }
private void OnDestroy() { MonoMgr.GetInstance().RemoveUpdateListener(UpdatedResetAix); }
public void RemoveListener() { MonoMgr.GetInstance().RemoveUpdateListener(UpdatedMusicUI); }
public void LoadSceneAsyn(int number, UnityAction action = null) { MonoMgr.GetInstance().StartCoroutine(RealLoadSceneAsyn(number, action)); }
public void RemoveListener() { MonoMgr.GetInstance().RemoveLateUpdateListener(ToActive); }