Example #1
0
    public static void OnLoadScene()
    {
        Scene scn = SceneSystem.Instance.mCurrentScene;

        if (scn == null)
        {
            return;
        }
        if (scn.mScnLists == null)
        {
            return;
        }
        if (scn.mScnLists.temp == 0)
        {
            return;
        }

        RectTransform canvas = UIRoot2D.Instance.GetComponent <RectTransform>();

        GameObject joystick = Resources.Load <GameObject>("GUI/UI_Joystick");

        if (joystick != null)
        {
            joystick = GameObject.Instantiate(joystick);
            RectTransform jt = joystick.GetComponent <RectTransform>();
            jt.parent     = canvas;
            jt.localScale = new Vector3(2.2f, 2.2f, 2.2f);
        }

        NavigationSystem.OnEnterScene();

        NetWork.SetSendHeartbeatCallback(OnHeartbeatSend);

        NetWork.RegisterNotify(STC.STC_PlayerMove, OnPlayerMove);
        NetWork.RegisterNotify(STC.STC_TargetChg, OnTargetChg);
        NetWork.RegisterNotify(STC.STC_SkillNotify, SkillNotify);
        NetWork.RegisterNotify(STC.STC_SkillBegin, SkillBeginFunc);
        NetWork.RegisterNotify(STC.STC_AtbNotify, AtbNotify);
        NetWork.RegisterNotify(STC.STC_HPChg, OnChgHp);
        NetWork.RegisterNotify(STC.STC_SetPos, OnSetPos);
    }