Пример #1
0
    // 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);
 }
Пример #3
0
 public void PlayAnim()
 {
     if (anim == null)
     {
         return;
     }
     anim.Play();
     MonoMgr.GetInstance().AddLateUpdateListener(UpdatedIsPlaying);
     MonoMgr.GetInstance().AddLateUpdateListener(AnimEndEvent);
 }
Пример #4
0
    // 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();
        });
    }
Пример #5
0
    /// <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);
    }
Пример #6
0
        /// <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);
        }
Пример #7
0
    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");
        });
    }
Пример #8
0
    //出栈
    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);
    }
Пример #9
0
    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);
            }
        }
    }
Пример #10
0
    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);
    }
Пример #11
0
 public override void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveUpdateListener(ActivePlayer);
     MonoMgr.GetInstance().RemoveLateUpdateListener(DownPlayerEvnet);
     MonoMgr.GetInstance().RemoveFixedUpdateListener(DownColliderEvent);
 }
Пример #12
0
 /// <summary>
 /// 构造函数里面添加Update监听
 /// </summary>
 public InputMgr()
 {
     MonoMgr.GetInstance().AddUpdateListener(Update);
 }
Пример #13
0
 private void OnEnable()
 {
     MonoMgr.GetInstance().AddUpdateListener(UpdatedResetAix);
 }
Пример #14
0
 public void LoadSceneAsyn(string name, UnityAction func)
 {
     //公共Mono模块
     MonoMgr.GetInstance().StartCoroutine(ReallyLoadSceneAsyn(name, func));
 }
Пример #15
0
 private void OnDestroy()
 {
     MonoMgr.GetInstance().RemoveLateUpdateListener(UpdatedIsPlaying);
     MonoMgr.GetInstance().RemoveLateUpdateListener(AnimEndEvent);
 }
Пример #16
0
 public void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveUpdateListener(UpdatedMarkAix);
 }
Пример #17
0
 public override void RemoveListener()
 {
     base.RemoveListener();
     MonoMgr.GetInstance().RemoveUpdateListener(UpadedSpring);
     EventCenter.GetInstance().RemoveEventListener("ResetPlayer", GameReset);
 }
Пример #18
0
 public void AddListener()
 {
     MonoMgr.GetInstance().AddUpdateListener(UpdatedMarkAix);
 }
 public void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveFixedUpdateListener(ControlRigBounsiness);
 }
 public void AddListener()
 {
     MonoMgr.GetInstance().AddFixedUpdateListener(ControlRigBounsiness);
 }
Пример #21
0
 public void AddListener()
 {
     MonoMgr.GetInstance().AddFixedUpdateListener(GravityModifier);
 }
Пример #22
0
 public void AddListener()
 {
     MonoMgr.GetInstance().AddLateUpdateListener(ToActive);
 }
Пример #23
0
 public void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveFixedUpdateListener(GravityModifier);
 }
Пример #24
0
 public AudioMgr()
 {
     MonoMgr.GetInstance().AddUpdateListener(audioUpdate);
 }
Пример #25
0
 //异步加载资源
 public void LoadAsync <T>(string name, UnityAction <T> callback) where T : Object
 {
     MonoMgr.GetInstance().StartCoroutine(ReallyLoadAsync <T>(name, callback));
 }
Пример #26
0
 public void AddListener()
 {
     MonoMgr.GetInstance().AddUpdateListener(UpdatedMusicUI);
 }
Пример #27
0
 private void OnDestroy()
 {
     MonoMgr.GetInstance().RemoveUpdateListener(UpdatedResetAix);
 }
Пример #28
0
 public void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveUpdateListener(UpdatedMusicUI);
 }
Пример #29
0
 public void LoadSceneAsyn(int number, UnityAction action = null)
 {
     MonoMgr.GetInstance().StartCoroutine(RealLoadSceneAsyn(number, action));
 }
Пример #30
0
 public void RemoveListener()
 {
     MonoMgr.GetInstance().RemoveLateUpdateListener(ToActive);
 }