示例#1
0
    // *** Main Initializer ***
    void Awake()
    {
        myTrans = transform;
        cam     = Camera.main;
        if (Camera.main)
        {
            zoneCameraControls = Camera.main.GetComponent <ZoneViewCamera>();
        }

        // @TODO: Make these a singleton pattern
        //currentZone = new Zone(1); // Required so Hex doesn't null ref currentZone
        Hex.Initialize();

        // Ideally, the only place state is manually set.
        state = beginningState;
        bool loading;

        switch (state)
        {
        case RelativityState.WorldDuel:
            loading = false; //@TODO: still caching on duel
            InitializeWorld(loading);

            InitializeCombat();
            combatManager.BeginDuel();
            break;

        case RelativityState.WorldMap:
            loading = true;
            InitializeWorld(loading);
            break;

        case RelativityState.ZoneMap:
            InitializeZone();
            break;

        case RelativityState.Caching:
            Debug.Log("got to game manager caching");
            loading = false;
            InitializeWorld(loading);
            Debug.Log("advanced past initialize");
            worldCacher = worldManagerObj.GetComponent <CreateWorldCache>();
            worldCacher.BuildCache(worldManager.activeWorld);
            break;

        default:
            Debug.LogError("Please set a state in GameManager.beginningState before playing.");
            break;
        }
    }
示例#2
0
    // *** Main Initializer ***
    void Awake()
    {
        myTrans = transform;
        cam = Camera.main;
        if (Camera.main)
          zoneCameraControls = Camera.main.GetComponent<ZoneViewCamera>();

        // @TODO: Make these a singleton pattern
        currentZone = new Zone(1); // Required so Hex doesn't null ref currentZone
        Hex.Initialize();

        // Ideally, the only place state is manually set.
        state = beginningState;
        bool loading;
        switch (state)
        {
          case GameState.WorldDuel:
        loading = false; //@TODO: still caching on duel
        InitializeWorld(loading);

        InitializeCombat();
        combatManager.BeginDuel();
          break;

          case GameState.WorldMap:
        loading = true;
        InitializeWorld(loading);
          break;

          case GameState.ZoneMap:
        InitializeZone();
          break;

          case GameState.Caching:
        loading = false;
        InitializeWorld(loading);

        worldCacher = worldManagerObj.GetComponent<CreateWorldCache>();
        worldCacher.BuildCache(worldManager.activeWorld);
          break;

          default:
        Debug.LogError("Please set a state in GameManager.beginningState before playing.");
          break;
        }
    }