示例#1
0
        public void Start()
        {
            dataManager           = DataManager.instance;
            infiniteObjectManager = InfiniteObjectManager.instance;
            infiniteObjectManager.Init();
            infiniteObjectHistory = InfiniteObjectHistory.instance;
            infiniteObjectHistory.Init(infiniteObjectManager.GetTotalObjectCount());
            sectionSelection = SectionSelection.instance;
            chaseController  = ChaseController.instance;

            moveDirection  = Vector3.forward;
            spawnDirection = Vector3.forward;
            turnPlatform   = new PlatformObject[(int)ObjectLocation.Last];
            turnIndex      = new int[(int)ObjectLocation.Last];
            turnScene      = new SceneObject[(int)ObjectLocation.Last];
            sceneTurnIndex = new int[(int)ObjectLocation.Last];

            infiniteObjectManager.GetObjectSizes(out platformSizes, out sceneSizes, out largestSceneLength);
            infiniteObjectManager.GetObjectStartPositions(out platformStartPosition, out sceneStartPosition);

            stopObjectSpawns            = false;
            spawnData                   = new ObjectSpawnData();
            spawnData.largestScene      = largestSceneLength;
            spawnData.useWidthBuffer    = true;
            spawnData.section           = 0;
            spawnData.sectionTransition = false;

            noCollidableProbability.Init();

            ShowStartupObjects(GameManager.instance.showTutorial);

            SpawnObjectRun(true);

            GameManager.instance.OnStartGame += StartGame;
        }
    public void Start()
    {
        dataManager = DataManager.instance;
        infiniteObjectManager = InfiniteObjectManager.instance;
        infiniteObjectManager.init();
        infiniteObjectHistory = InfiniteObjectHistory.instance;
        infiniteObjectHistory.init(infiniteObjectManager.getTotalObjectCount());
        sectionSelection = SectionSelection.instance;
        chaseController = ChaseController.instance;

        moveDirection = Vector3.forward;
        spawnDirection = Vector3.forward;
        turnPlatform = new PlatformObject[(int)ObjectLocation.Last];

        infiniteObjectManager.getObjectSizes(out platformSizes, out sceneSizes, out largestSceneLength);
        infiniteObjectManager.getObjectStartPositions(out platformStartPosition, out sceneStartPosition);

        stopObjectSpawns = false;
        spawnData = new ObjectSpawnData();
        spawnData.largestScene = largestSceneLength;
        spawnData.useWidthBuffer = true;
        spawnData.section = 0;
        spawnData.sectionTransition = false;

        noCollidableProbability.init();

        showStartupObjects(GameManager.instance.showTutorial);

        spawnObjectRun(true);
    }
示例#3
0
        private void SpawnChaseObject()
        {
            GameObject prefab;

            if ((prefab = dataManager.GetChaseObjectPrefab()) != null)
            {
                chaseController = (GameObject.Instantiate(prefab) as GameObject).GetComponent <ChaseController>();
            }
        }
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
示例#5
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     bee = other.GetComponentInChildren <Bee>();
     /* if the bee is not at the hive... */
     if (!bee.getEscaped() && bee != null)
     {
         /* if we have enough energy...*/
         if (energy > 1f)
         {
             /* start the chase */
             ChaseController chaseController = ChaseController.Instance;
             if (chaseController != null)
             {
                 chaseController.StartChase(this, bee);
             }
         }
     }
 }
示例#6
0
 public void Awake()
 {
     instance = this;
 }
示例#7
0
 void Awake()
 {
     chaseController = this;
 }
示例#8
0
 private void spawnChaseObject()
 {
     GameObject prefab;
     if ((prefab = dataManager.getChaseObjectPrefab()) != null) {
         chaseController = (GameObject.Instantiate(prefab) as GameObject).GetComponent<ChaseController>();
     }
 }