Inheritance: MonoBehaviour
コード例 #1
0
    // Use this for initialization
    private void Start()
    {
        worldController = WorldController.instance;

        baseBodyScaleX = bodyTransform.localScale.x;
        baseBodyScaleZ = bodyTransform.localScale.z;
    }
コード例 #2
0
 public static WorldController getInstance()
 {
     if (instance == null)
     {
         instance = new WorldController();
     }
     return instance;
 }
コード例 #3
0
    private void Awake()
    {
        if (instance == null)
            instance = this;

        else if (instance != this)
        {
            Debug.LogError("Tried to created another instance of " + GetType() + ". Destroying.");
            Destroy(gameObject);
        }
    }
コード例 #4
0
ファイル: WorldController.cs プロジェクト: Endure-Game/Endure
    // Use this for initialization
    void Start()
    {
        instance = this;
        roomScript = GetComponent<RoomManager>();
        InitGame();

        this.player = PlayerController.instance;
        this.camera = CameraController.instance;

        this.roomWidth = this.roomScript.columns;
        this.roomHeight = this.roomScript.rows;

        this.numRooms = this.roomScript.roomSide;
    }
コード例 #5
0
ファイル: Player.cs プロジェクト: akanarika/round5
    void Awake()
    {
        streak = 0;
        _previousTrigger = 0;
        _playerState = PlayerState.Inactive;
        _inputController = InputController.Instance;
        _rhythmController = RhythmController.Instance;
        _worldController = WorldController.Instance;
        _soundManager = SoundManager.Instance;
        _config = Config.Instance;
        _scoreController = ScoreController.Instance;
        _menuController = MenuController.Instance;
        _titleController = TitleController.Instance;
        
		feedbackAnim = GameObject.Find ("Feedbacks/Feedback" + index).GetComponent<Animator>();
    }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        world = new World();
        _instance = this;

        //Create game object for each tile
        for (int x = 0; x < world.Width; x++) {
            for (int y = 0; y < world.Height; y++) {
                GameObject tile_go = new GameObject ();
                Tile tile_data = world.getTileAt (x, y);

                tile_go.name = "Tile_" + x + "_" + y;
                tile_go.transform.position = new Vector3 (tile_data.X, tile_data.Y, 0);
                tile_go.transform.SetParent (this.transform, true);

                tile_go.AddComponent<SpriteRenderer> ();

                tile_data.RegisterTileTypeChangedCB ( (tile) => { onTileTypeChanged(tile, tile_go);});
            }
        }

        world.RandomizeTiles();
    }
コード例 #7
0
ファイル: World.cs プロジェクト: cyanpunk/muonline
    IEnumerator Start()
    {
        InitGlobal();
        InitWorld();
        InitUI();

        //проверка все ли есть на сцене
        if (Terrain.activeTerrain==null) { ui.error("ErrorCreateMap", "Terrain"); yield break; }
        else if (cam==null) { ui.error("ErrorCreateMap", "Camera"); yield break; }
        else if (scene==null) { ui.error("ErrorCreateMap", "Scene"); yield break; }

        //инициализация компонентов мира
        map			= scene.AddComponent<Map>();
        players		= scene.AddComponent<Players>();
        effects		= scene.AddComponent<MapEffects>();
        controller	= scene.AddComponent<WorldController>();

        //передача в players tiles
        map.EventDataTiles += delegate(MapDataGround.Tile[,] data) {
            players.tiles = data;
        };

        //передача в players zones
        map.EventDataZones += delegate(byte[,] data) {
            players.zones = data;
        };

        //подпрограммы инциализаций компонентов
        yield return StartCoroutine(map.Init());
        yield return StartCoroutine(players.Init());
        yield return StartCoroutine(effects.Init());
        yield return StartCoroutine(controller.Init());

        CreateMe();

        yield break;
    }
コード例 #8
0
ファイル: PlayerController.cs プロジェクト: Stumpstump/slide
 void Awake()
 {
     wc = GameObject.FindGameObjectWithTag("GameController").GetComponent<WorldController>();
     rb = gameObject.GetComponent<Rigidbody2D>();
 }
コード例 #9
0
	void init () {
		Instance = this;
		//TODO: Insert initialization/world loading code here
		getGameProgress();
	}
コード例 #10
0
 // Use this for initialization
 private void Start()
 {
     worldController = FindObjectOfType<WorldController>();
     worldTimeController = FindObjectOfType<WorldTimeController>();
 }
コード例 #11
0
ファイル: BallLayer.cs プロジェクト: kkabdol/RotateToClean
 void Awake()
 {
     worldController = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<WorldController> ();
 }
コード例 #12
0
 void Awake()
 {
     singleton = this;
 }
コード例 #13
0
 void OnDestroy()
 {
     singleton = null;
 }
コード例 #14
0
 void Awake()
 {
     instance = this;
     player = FindObjectOfType<PlayerController>();
 }