Example #1
0
    private void Awake()
    {
        playerBehaviour      = this;
        playerAnimator       = GetComponent <Animator>();
        playerAudioSource    = GetComponent <AudioSource>();
        GroudedCollider      = GetComponent <CapsuleCollider>();
        animationHash        = GetComponent <AnimationHash>();
        playerRigidbody      = GetComponent <Rigidbody>();
        particleManager      = GetComponent <ParticleManager>();
        attackSystem         = GetComponent <AttackSystem>();
        gravity              = GetComponent <Gravity>();
        damageCollider       = GetComponent <CapsuleCollider>();
        objectPoolManager    = GetComponent <ObjectPoolManager>();
        getHitComponent      = GetComponent <GetHitComponent>();
        PlayerShader.enabled = false;

        gameStageData    = GameFacade.GetInstance().gameStageData;
        playerController = GameFacade.GetInstance().playerController;
        playerParameter  = gameStageData.CurPlayerStageData.playerData.playerParameter;
        playerData       = gameStageData.CurPlayerStageData.playerData;

        floorMask = LayerMask.GetMask("Floor");

        playerState = PlayerState.Move;
        ForceMove   = false;
        canfall     = true;
        canTriggerFallingCoroutine = true;
        CreateWeapon();
    }
Example #2
0
    public void NextStage()
    {
        PlayerData playerData = GameFacade.GetInstance().playerData;

        StageData[] stageDatas = GameFacade.GetInstance().stageDatas;
        playerData.StageIndex = Mathf.Min(playerData.StageIndex + 1, stageDatas.Length - 1);
    }
Example #3
0
    //初始化游戏基础
    static public void InitGameBase()
    {
        //设置Log
        Application.logMessageReceived         += OnLog;
        Application.logMessageReceivedThreaded += OnLog;
        //初始化游戏引擎的一些设置
        GameSettings.OnInit();
        // MVC
        GameFacade.GetInstance().OnInit();
        // 场景管理
        mSceneManager = MySceneManager.GetInstance();
        mSceneManager.OnInit();
        //添加全局FPS组件
        Main.Instance.AddMainComponent <ShowFPS>();
        //添加全局InGameLog组件
        Main.Instance.AddMainComponent <InGameLog>();
        // 对象池管理
        GameObject poolRoot = new GameObject("GameObjectPool");

        poolRoot.transform.SetParent(Main.Instance.transform);
        GameObjectPool.GetInstance().root = poolRoot;
        //Network
        NetManager.GetInstance().OnInit();
        //Add temp entrance.
        Main.Instance.AddMainComponent <TempEntrance>();

        initState = GameInitState.GameBaseInited;
    }
Example #4
0
 private void Awake()
 {
     playerData       = GameFacade.GetInstance().playerData;
     levelData        = GameFacade.GetInstance().levelData;
     gameUIController = GameFacade.GetInstance().GameUIController;
     gameStateData    = GameFacade.GetInstance().gameStateData;
 }
Example #5
0
    private void Awake()
    {
        gameStageData = GameFacade.GetInstance().gameStageData;
        inputSetting  = GameFacade.GetInstance().inputSetting;

        playerBehaviour = GetComponent <PlayerBehaviour>();
    }
Example #6
0
 private void Awake()
 {
     animator         = GetComponent <Animator>();
     meshFader        = GetComponent <MeshFader>();
     audioSource      = GetComponent <AudioSource>();
     healthComponent  = GetComponent <HealthComponent>();
     playerController = GameFacade.GetInstance().PlayerController;
 }
 private void Awake()
 {
     Input.multiTouchEnabled = true;
     gameStateData           = GameFacade.GetInstance().gameStateData;
     audioController         = GameFacade.GetInstance().AudioController;
     enemyController         = GameFacade.GetInstance().EnemyController;
     gameUIController        = GameFacade.GetInstance().GameUIController;
 }
Example #8
0
 public override void StateEnd()
 {
     if (GameFacade.GetInstance().isGameOver)
     {
         m_controller.SetState(new MainMenuState(m_controller));
     }
     GameFacade.GetInstance().Release();
 }
 protected virtual void Awake()
 {
     rigid            = GetComponent <Rigidbody>();
     audioSource      = GetComponent <AudioSource>();
     playerController = GameFacade.GetInstance().PlayerController;
     meshFader        = GetComponent <MeshFader>();
     col = GetComponent <Collider>();
 }
Example #10
0
    private void Awake()
    {
        gameStageController = GameFacade.GetInstance().gameStageController;
        gameStageData       = GameFacade.GetInstance().gameStageData;

        concentric = Instantiate(ConcentricPrefab, GameObject.FindGameObjectWithTag("UI").transform).GetComponent <Image>();

        mainCamera = this;
    }
Example #11
0
    //public GameObject Weapon;

    private void Awake()
    {
        gameStageData = GameFacade.GetInstance().gameStageData;
        GameObject mainCamera = Instantiate(gameStageData.CurPlayerStageData.playerData.MainCamera, new Vector3(0, 0, 0), playerStartPos.rotation);
        GameObject player     = Instantiate(gameStageData.CurPlayerStageData.playerData.Player, playerStartPos.position, playerStartPos.rotation);

        mainCameraBehaviour = mainCamera.GetComponent <MainCamera_New>();
        playerBehaviour     = player.GetComponent <PlayerBehaviour>();
    }
Example #12
0
    IEnumerator LoadData()
    {
        yield return(new WaitForEndOfFrame());

        playerData = GameFacade.GetInstance().stageDataController.PlayerJson;

        /* Debug.Log(playerData.Score);
         * text.text = playerData.Score.ToString();/*/
        // Debug.Log(playerData.MaxFallSpeed);
    }
Example #13
0
    private void Init()
    {
        playerBehaviour = this;
        rigidbody2      = gameObject.GetComponent <Rigidbody2D>();
        gameManager     = GameFacade.GetInstance().gameManager;
        StartCoroutine(LoadData());


        //   gameObject.transform.parent.gameObject.transform.position = StartPosition.position;
    }
Example #14
0
 private void Awake()
 {
     healthBehavior   = GetComponent <HealthComponent>();
     audioSource      = GetComponent <AudioSource>();
     meshFader        = GetComponent <MeshFader>();
     animator         = GetComponent <Animator>();
     dropableBehavior = GetComponent <DropableBehavior>();
     playerController = GameFacade.GetInstance().PlayerController;
     gameUIController = GameFacade.GetInstance().GameUIController;
     gameStateData    = GameFacade.GetInstance().gameStateData;
 }
Example #15
0
 public override void StateStart()
 {
     GameFacade.GetInstance().Init();
 }
Example #16
0
 private void Awake()
 {
     Input.multiTouchEnabled = true;
     enemyController         = GameFacade.GetInstance().EnemyController;
 }
Example #17
0
 private void Awake()
 {
     gameStageController = GameFacade.GetInstance().gameStageController;
     gameStageData       = GameFacade.GetInstance().gameStageData;
 }
Example #18
0
 private void Awake()
 {
     objectPool = GameFacade.GetInstance().objectPool;
     CreatObjectPoolItemInfoCollection();
 }
 private void Awake()
 {
     dropItemData = GameFacade.GetInstance().dropItemData;
 }
Example #20
0
 public override void StateUpdate()
 {
     GameFacade.GetInstance().Update();
 }
 private void Awake()
 {
     gameStateData = GameFacade.GetInstance().gameStateData;
 }
Example #22
0
 static public void OnReset()
 {
     UpdateManager.GetInstance().OnReset();
     GameFacade.GetInstance().OnReset();
     mSceneManager.OnReset();
 }
Example #23
0
 private void Awake()
 {
     playerData = GameFacade.GetInstance().playerData;
     levelData  = GameFacade.GetInstance().levelData;
     RefreshPlayerData();
 }
Example #24
0
 private void Init()
 {
     //  GameFacade.GetInstance().stageDataController.
     playerController   = gameObject.GetComponent <PlayerController>();
     obstacleController = GameFacade.GetInstance().obstacleController;
 }
 public void Awake()
 {
     Input.multiTouchEnabled = true;
     enemyController         = GameFacade.GetInstance().EnemyController;
     gameStateData           = GameFacade.GetInstance().gameStateData;
 }
Example #26
0
 private void Awake()
 {
     gameStateData    = GameFacade.GetInstance().gameStateData;
     gameUIController = GameFacade.GetInstance().GameUIController;
     audioController  = GameFacade.GetInstance().AudioController;
 }