示例#1
0
    void RefreshPallet()
    {
        SpriteRenderer r = this.SpriteRender;

        if (r == null)
        {
            return;
        }
        Material mat = r.sharedMaterial;

        if (mat == null)
        {
            return;
        }

        var imageRes = StageMgr.GetInstance().ImageRes;

        if (imageRes != null && imageRes.LoadOk)
        {
            var frame = imageRes.GetImageFrame((PlayerState)m_Group, m_Image);
            if (frame != null)
            {
                StageMgr.GetInstance().LinkImageFramePalletLastLink(frame);
                var palletTex = frame.LocalPalletTex;
                mat.SetTexture("_PalletTex", palletTex);
                m_IsPalletNull = palletTex == null;
            }
        }
    }
示例#2
0
    public void InitAnimated(BgAniInfo anInfo)
    {
        if (anInfo == null)
        {
            return;
        }
        layerno = anInfo.layerno;
        var imageRes = StageMgr.GetInstance().ImageRes;

        if (imageRes != null && imageRes.LoadOk)
        {
            // 处理动画层
            m_Group    = anInfo.actionno;
            m_MaskType = anInfo.mask;

            m_SceneType = SceneLayerType.Animation;
            m_TransType = anInfo.transType;
            InitSpriteRender(anInfo.transType);
            m_IsInited = true;

            if (StageMgr.GetInstance().HasBeginAction(m_Group))
            {
                // 初始化动画
                var ani = this.ImageAni;
                if (ani != null)
                {
                    ani.Type = ImageAnimation.ImageAnimationType.Scene;
                    if (ani.PlayerPlayerAni((PlayerState)m_Group, true))
                    {
                        RefreshCurFrame(ani);
                    }
                }
            }
        }
    }
示例#3
0
    public void InitStatic(BgStaticInfo bgInfo)
    {
        if (bgInfo == null)
        {
            return;
        }
        layerno = bgInfo.layerno;

        var imageRes = StageMgr.GetInstance().ImageRes;

        if (imageRes != null && imageRes.LoadOk)
        {
            m_Group     = bgInfo.srpiteno_Group;
            m_Image     = bgInfo.spriteno_Image;
            m_MaskType  = bgInfo.mask;
            m_SceneType = SceneLayerType.Static;
            m_TransType = bgInfo.transType;
            InitSpriteRender(bgInfo.transType);

            var frame = imageRes.GetImageFrame((PlayerState)bgInfo.srpiteno_Group, bgInfo.spriteno_Image);
            UpdateImageFrame(frame, ActionFlip.afNone, ActionDrawMode.adNone, bgInfo.mask == MaskType.none);


            m_IsInited = true;
        }
    }
示例#4
0
    public void ClearCurrentState()
    {
        CinemaManager cm = GameObject.FindObjectOfType <CinemaManager>();

        if (cm != null)
        {
            cm.Clear();
        }
        _IsSenseMode = false;
        nextBattle_  = null;
        XInput.Instance.dealInput = true;
        CreatePlayerRole.Reset();
        GlobalInstanceFunction.Instance.Clear();
        Battle.Instance.ResetData();
        TeamSystem._MyTeamInfo = null;
        Prebattle.Instance.Fini();
        Prebattle.Instance.StopAllAutoSystem();
        Prebattle.Instance.nextInfo_   = null;
        Prebattle.Instance.tooFastOper = false;
        StageMgr.ClearStageLoadQue();
        EffectMgr.Instance.DeleteAll();
        GamePlayer.Instance.isInBattle = false;
        GuildSystem.Clear();
        TeamSystem.Clear();
        SuccessSystem.Clear();
        GatherSystem.instance.Clear();
        GuideManager.Instance.ClearMask();
        UIFactory.Instance.ClearLoadedUI();
        SoundTools.StopMusic();
        RaiseUpSystem.Clear();
        BagSystem.instance.BagClear();
        PopText.Instance.Clear();
        GamePlayer.Instance.babies_list_.Clear();
    }
示例#5
0
 private void Init()
 {
     // 프레임 고정
     QualitySettings.vSyncCount  = 0;
     Application.targetFrameRate = 30;
     stageMgr = stageMgr_obj.GetComponent <StageMgr>();
 }
示例#6
0
 private void Awake()
 {
     instance  = this;
     m_SaveMgr = GameObject.Find("SaveDataManager").GetComponent <SaveDataManager>();
     m_Data    = GameObject.Find("Santa").GetComponent <PlayerData>();
     rscs      = GameObject.Find("ResultScoreContainer").GetComponent <ResultScoreContainerScript>();
 }
示例#7
0
 private void Btn_ParcticeStart()
 {
     UiTips.Show("Btn_ParcticeStart");
     StageMgr.Data            = new StageData();
     StageMgr.Data.CurLevelId = 2;
     StageMgr.Data.PlayerId   = 2;
     StageMgr.StartGame();
 }
示例#8
0
 void OnEnable()
 {
     stageMgr             = GameObject.Find("StageMgr").GetComponent <StageMgr>();
     saveMgr              = GameObject.Find("SaveDataManager").GetComponent <SaveDataManager>();
     rscs                 = GameObject.Find("ResultScoreContainer").GetComponent <ResultScoreContainerScript>();
     pdata                = GameObject.Find("Santa").GetComponent <PlayerData>();
     saveFeatureAvailable = (ObjectManager.m_Inst != null && stageMgr != null && saveMgr != null && rscs != null && pdata != null);
 }
示例#9
0
 public virtual void Init()
 {
     anim               = GetComponent <Animator>();
     myColor            = new Color(1, 1, 1, 1);
     stageMgr           = FindObjectOfType <StageMgr>();
     spriteRenderer     = GetComponent <SpriteRenderer>();
     characterLayerMask = 1 << LayerMask.NameToLayer("Character");
     MyPos              = new Vector3(0, GetComponent <SpriteRenderer>().size.y / 2 * transform.localScale.y, 0);
 }
示例#10
0
 public static void ExcuteAllLoadedEvent()
 {
     ApplicationEntry.Instance.switchSceneMask_.SetActive(false);
     GameManager.Instance.EnableDelayCheck(true);
     if (GlobalValue.isBattleScene(Application.loadedLevelName))
     {
         StageMgr.SceneLoadedFinish();
     }
 }
示例#11
0
 public void ReturnToLogin()
 {
     if (!ScenePreloader.Instance.isPreLoading)
     {
         GameManager.Instance.ClearCurrentState();
     }
     StageMgr.OnSceneLoaded += OnLoginLoaded;
     StageMgr.LoadingAsyncScene(GlobalValue.StageName_ReLoginScene);
 }
示例#12
0
    void UpdateMove(float deltaTime)
    {
        if (Mathf.Abs(Vec.x) <= float.Epsilon && Mathf.Abs(Vec.y) <= float.Epsilon)
        {
            if (m_Display == null || m_Display.Attribe.StandType != Cns_Type.A)
            {
                return;
            }
        }
        // 按照毫秒算速度
        float d = deltaTime * 1000f;

        if (m_Display != null && m_Display.Attribe.StandType == Cns_Type.A)
        {
            float gg = (-g + A.y) / (PlayerDisplay._cVelPerUnit * PlayerDisplay._cAPerUnit);
            //float gg = -g/1000000f * 6.5f;
            Vec.y += gg * d;
        }

        float   Ax = IsFlipX ? -A.x: A.x;
        Vector2 vv = new Vector2(Vec.x * (IsFlipX? -1:1), Vec.y);

        if (m_Display != null && m_Display.Attribe.StandType != Cns_Type.A &&
            (Mathf.Abs(vv.x) > float.Epsilon || Mathf.Abs(Ax) > float.Epsilon))
        {
            float oldVx = vv.x;
            // 动态摩擦因子
            float u = AppConfig.GetInstance().u *StageMgr.GetInstance().u;
            // 摩擦力的向下地面fn
            float aX = u / 100f * g;
            if (vv.x > 0)
            {
                aX = -aX;
            }
            aX  += Ax;
            vv.x = aX * deltaTime + vv.x;
            if (oldVx * vv.x < 0)
            {
                vv.x = 0;
            }
        }

        Vector2 org = this.OffsetPos;

        org += vv * d;
        if (org.y < 0)
        {
            //Vec.y = 0;
            org.y = 0;
        }
        this.OffsetPos = org;
        if (m_Display != null)
        {
            m_Display.InternalUpdatePos();
            //Debug.LogError (m_Display.transform.localPosition.z.ToString ());
        }
    }
示例#13
0
 void Start()
 {
     stageMgr = GameObject.Find("StageMgr").GetComponent <StageMgr>();
     saveMgr  = GameObject.Find("SaveDataManager").GetComponent <SaveDataManager>();
     if (ObjectManager.m_Inst == null || stageMgr == null || saveMgr == null)
     {
         enabled = false;
     }
 }
示例#14
0
    void Start()
    {
        stageMgr_obj = GameObject.Find("StageManager");
        stageMgr_cmp = stageMgr_obj.GetComponent <StageMgr>();
        //プレイヤーを取得する
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <TestPlayer>();

        NowSceneName = stageMgr_cmp.Scenename;
        thisobject   = this;
    }
示例#15
0
    IEnumerator StartFrame()
    {
        float sec = 0.0f;
        int frame = 0;

        source.Play();

        while (true)
        {
            yield return null;

            mRenderer.sharedMaterial.mainTexture = textures[frame];

            sec += Time.deltaTime;

            if (sec >= 0.09f)
            {
                sec = 0.0f;
                if (frame < textures.Length - 1)
                {
                    frame++;
                }
                else
                {
                    break;
                }
            }
        }

        yield return new WaitForSeconds(0.2f);


        SoundMgr.PlayBGM();
        StageMgr sm = FindObjectOfType<StageMgr>();

        //if (sm.isFinish)
        //{
        if (sm.isRestart)
        {
            sm.RestartGo();
        }
        else
        {
            sm.Continue();
        }
        
        //}
        //else
        //{
        //    sm.Restart();
        //}
        //FindObjectOfType<StageMgr>().Restart();
        // Debug.Log("Finish");
    }
示例#16
0
    public bool HasImage(PlayerState group, int index)
    {
        if (group == PlayerState.psNone)
        {
            return(false);
        }

        if (Type == ImageAnimationType.Player)
        {
            PlayerDisplay displayer = this.CacheDisplayer;
            if (displayer == null)
            {
                return(false);
            }
            var loaderPlayer = displayer.LoaderPlayer;
            if (loaderPlayer == null)
            {
                return(false);
            }
            var imgRes = loaderPlayer.ImageRes;
            if (imgRes == null)
            {
                return(false);
            }
            var imgLib = imgRes.ImgLib;
            if (imgLib == null)
            {
                imgRes.Init();
                imgLib = imgRes.ImgLib;
                if (imgLib == null)
                {
                    return(false);
                }
            }

            var frame = imgLib.GetImageFrame(group, index);
            if (frame != null && frame.Data != null)
            {
                return(true);
            }
        }
        else if (Type == ImageAnimationType.Scene)
        {
            var frame = StageMgr.GetInstance().ImageRes.GetImageFrame(group, index);
            if (frame != null && frame.Data != null)
            {
                return(true);
            }
        }

        return(false);
    }
示例#17
0
 public void OnDestroy()
 {
     try
     {
         StageMgr.Dispose();
         UIMgr.Dispose();
         LevelMgr.Dispose();
         AssetBundleMgr.Dispose(IsDisposeAssetBundleInQuit);
         DataMgr.Dispose();
         Commander.Dispose();
     }
     catch {}
 }
示例#18
0
 void Start()
 {
     mainCamera = Camera.main;
     metaDatas  = PlayerData.GetMetaData();
     maxCount   = metaDatas.Count;
     ani        = Camera.main.GetComponent <Animator> ();
     foreach (int sid in metaDatas.Keys)
     {
         PlayerData pData = PlayerData.GetData(sid);
         roleKeys.Add(sid);
         playDatas.Add(pData);
         CreateAlternativePlayerObj(pData, sid);
     }
     HidePlayerObj();
     StageMgr.SceneLoadedFinish();
 }
示例#19
0
 public void Awake()
 {
     DataMgr.SetLog(this);
     Commander.SetLog(this);
     UIMgr.SetLog(this);
     //>========================
     Starter.Initialized(this);
     AssetMgr.Initialized(LevelMgr);
     AssetBundleMgr.Initialized(LevelMgr, AssetBundleExtension);
     UIMgr.Initialized(AssetMgr, AssetBundleMgr);
     StageMgr.SetUpdateInterval(StageUpdateInterval);
     DontDestroyOnLoad(gameObject);
     Starter.RegisterOptionObject(gameObject);
     Starter.RegisterOptionByChildren(gameObject);
     Instance = GetComponent <IGameInstance>();
 }
示例#20
0
    internal bool SetStateFrameList(PlayerState state)
    {
        if (Type == ImageAnimationType.Player)
        {
            PlayerDisplay displayer = this.CacheDisplayer;
            if (displayer == null)
            {
                return(false);
            }

            var loaderPlayer = displayer.LoaderPlayer;
            if (loaderPlayer == null)
            {
                return(false);
            }

            var imgRes = loaderPlayer.ImageRes;
            if (imgRes == null)
            {
                return(false);
            }

            var imgLib = imgRes.ImgLib;
            if (imgLib == null)
            {
                imgRes.Init();
                imgLib = imgRes.ImgLib;
                if (imgLib == null)
                {
                    return(false);
                }
            }
            m_FrameList = imgLib.GetAnimationNodeList(state);
            return(true);
        }
        else if (Type == ImageAnimationType.Scene)
        {
            m_FrameList = StageMgr.GetInstance().ImageRes.GetAnimationNodeList(state);
            return(true);
        }
        else
        {
            return(false);
        }
    }
示例#21
0
    static public string userName_ = ""; //开发模式

    void Start()
    {
        HeadIconLoader.Instance.LoadIcon("loginBack", loginback);
        ConfigLoader.Instance.finishDownFileEvent   += new RequestEventHandler <int>(OnStartGame);
        VersionManager.Instance.versionNumEvent     += new RequestEventHandler <string>(OnVerSionNumEvent);
        VersionManager.Instance.finishDownFileEvent += new RequestEventHandler <int>(OnFinishDownFileEvent);
        buildVer.text   = GameManager.Instance.GetVersionNum();
        OnClickedTimer_ = 0f;
        string localServInfo = PlayerPrefs.GetString(servSaveStr);

        string[] splitted = localServInfo.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
        if (splitted.Length == 2)
        {
            GameManager.ServName_ = splitted[0];
            GameManager.ServId_   = int.Parse(splitted[1]);
        }
        selectServName_.text = GameManager.ServName_;

        NetConnection.Instance.OnSocketError += OnSocketException;
        ARPCProxy.OnSessionFailed            += SessionFailedHandler;
        CommonEvent.OnUserExternal           += OnUserExternal;
        UIManager.SetButtonEventHandler(m_LoginB.gameObject, EnumButtonEvent.OnClick, OnClickm_LoginB, 0, 0);
        UIManager.SetButtonEventHandler(debugLoginBtn.gameObject, EnumButtonEvent.OnClick, OnClickdebugLoginBtn, 0, 0);
        UIManager.SetButtonEventHandler(logOutBtn.gameObject, EnumButtonEvent.OnClick, OnUnReg, 0, 0);

        UIEventListener.Get(selectServ_).onClick += (GameObject go) => {
            selectServPanel_.SetActive(true);
            if (ApplicationEntry.Instance.isChcekFile)
            {
                m_LoginB.gameObject.SetActive(true);
            }
        };

        StageMgr.SceneLoadedFinish();

        //if(File.Exists(Application.persistentDataPath+ "/CopyVersion.txt"))
        //{
        //    string[] strArr = File.ReadAllText(Application.persistentDataPath + "/CopyVersion.txt").Split(';');
        //    //versionLab.gameObject.SetActive(true);
        //    //versionLab.text = strArr[0];
        //}

        InvokeRepeating("checkSdkInitFinish", 0.1f, 0.5f);
        resVer.text = ApplicationEntry.Instance.ResVersion;
    }
示例#22
0
    public void InitStatic(BgStaticInfo bgInfo)
    {
        if (bgInfo == null)
        {
            return;
        }
        layerno = bgInfo.layerno;

        var imageRes = StageMgr.GetInstance().ImageRes;

        if (imageRes != null && imageRes.LoadOk)
        {
            var frame = imageRes.GetImageFrame((PlayerState)bgInfo.srpiteno_Group, bgInfo.spriteno_Image);
            UpdateImageFrame(bgInfo.srpiteno_Group, frame);
            m_Group    = bgInfo.srpiteno_Group;
            m_Image    = bgInfo.spriteno_Image;
            m_IsInited = true;
        }
    }
示例#23
0
    public void EnterScene(AsyncOperation async = null)
    {
        if (async != null)
        {
            async.allowSceneActivation = true;
        }
        ScenePreloader.Instance.AllowEnter();
        StageMgr.ExcuteBeginLoadEvent();
        GlobalInstanceFunction.Instance.Invoke(() => {
            Resources.UnloadUnusedAssets();
            System.GC.Collect();

            StageMgr.ExcuteLoadedEvent();
            if (!manualCloseUI_)
            {
                DestroyLoadingUI();
            }
        }, 1);
        async = null;
    }
示例#24
0
    public ImageFrame GetImageFrame(int group, int image)
    {
        if (Type == ImageAnimationType.Player)
        {
            PlayerDisplay displayer = this.CacheDisplayer;
            if (displayer == null)
            {
                return(null);
            }
            var loaderPlayer = displayer.LoaderPlayer;
            if (loaderPlayer == null)
            {
                return(null);
            }
            var imgRes = loaderPlayer.ImageRes;
            if (imgRes == null)
            {
                return(null);
            }
            var imgLib = imgRes.ImgLib;
            if (imgLib == null)
            {
                imgRes.Init();
                imgLib = imgRes.ImgLib;
                if (imgLib == null)
                {
                    return(null);
                }
            }

            return(imgLib.GetImageFrame((PlayerState)group, image));
        }
        else if (Type == ImageAnimationType.Scene)
        {
            return(StageMgr.GetInstance().ImageRes.GetImageFrame((PlayerState)group, image));
        }
        else
        {
            return(null);
        }
    }
示例#25
0
文件: Player.cs 项目: woosub/TMJ
    // Use this for initialization
    void Start()
    {
        //SimpleGesture.On4AxisFlickSwipeDown(SwipeDown);
        //SimpleGesture.On4AxisFlickSwipeUp(SwipeUp);
        //SimpleGesture.On4AxisFlickSwipeLeft(SwipeLeft);
        //SimpleGesture.On4AxisFlickSwipeRight(SwipeRight);

        //playSpeed = gamePlaySpeed;


        coinEffect.SetActive(false);

        sky       = transform.Find("Sky");
        camera    = transform.Find("Main Camera");
        control   = transform.Find("Control");
        character = control.Find("Character").GetComponent <SpriteRenderer>();
        flat      = control.transform.position.y;

        shadow = transform.Find("Shadow");

        sm = FindObjectOfType <StageMgr>();
    }
示例#26
0
    protected void Awake()
    {
        if (m_inst != null)
        {
            Destroy(gameObject);
            return;
        }

        m_inst = this;

        DBMgr.InitInst();
        MapMgr.InitInst();
        UnitMgr.InitInst();
        EffectMgr.InitInst();
        ElementMgr.InitInst();
        ChipMgr.InitInst();
        ObjectPool.InitInst();
        CamMgr.InitInst();

        m_audioBgm        = transform.GetComponent <AudioSource> ();
        m_clipDeleteEnemy = Resources.Load <AudioClip> ("Sound/Bgm/EnemyDeleted");
        m_clipGameover    = Resources.Load <AudioClip> ("Sound/Bgm/Gameover");
    }
示例#27
0
    // Update is called once per frame
    void Update()
    {
        if (IsPause)
        {
            Time.timeScale = 0;
            //ポーズ中のなにか
        }
        else
        {
            Time.timeScale = 1;
        }

        //StageMgrのStartよりも後に呼ばれるらしい?のでこのばしょでステージmgrをくっつける
        if (Scene_Reloded)
        {
            stageMgr_obj = GameObject.Find("StageManager");
            if (stageMgr_obj == null)
            {
                return;
            }
            stageMgr_cmp = thisobject.stageMgr_obj.GetComponent <StageMgr>();
            if (stageMgr_cmp.respawnPoint != null)
            {
                player.transform.position = stageMgr_cmp.respawnPoint.transform.position;
            }
            Scene_Reloded = false;
            //ここでシーンのアクティブを調節sるう
            SceneManager.SetActiveScene(SceneManager.GetSceneByName(NowSceneName));
        }

        //ポーズによる遷移
        if (Input.GetButtonDown("Cancel"))
        {
            PauseStart();
        }
    }
示例#28
0
 //续关
 private void BtnRetry()
 {
     this.Close();
     StageMgr.Retry();
 }
示例#29
0
 void InPutpassWord(string str)
 {
     password = str;
     StageMgr.LoadingAsyncScene(GlobalValue.StageName_groupScene);
     //NetConnection.Instance.joinTeam((uint)minfot.teamId_,str);
 }
示例#30
0
 // Use this for initialization
 void Start()
 {
     p  = transform.GetComponentInParent <Player>();
     sm = FindObjectOfType <StageMgr>();
 }