コード例 #1
0
ファイル: Entity.cs プロジェクト: saint-angels/rovio_test
 public void Init(Vector2Int gridPosition, GridNavigator gridNavigator, Sprite sprite, EntityType type, EntityFaction faction, LevelService levelService)
 {
     this.levelService  = levelService;
     this.gridNavigator = gridNavigator;
     GridPosition       = gridPosition;
     Type       = type;
     Faction    = faction;
     EntityView = GetComponent <EntityView>() ?? gameObject.AddComponent <EntityView>();
     EntityView.Init(this, sprite, type, gridPosition, levelService);
 }
コード例 #2
0
        private void Start()
        {
            // Load the level
            levelService = new LevelService();
            GridNavigator gridNavigator = GetComponent <GridNavigator>() ?? gameObject.AddComponent <GridNavigator>();

            levelService.Init("Level2", this, gridNavigator);

            hud = GameObject.Find("Canvas").GetComponent <BattleHUD>();
            hud.OnEndTurnClicked += OnEndTurnClicked;

            inputSystem = GetComponent <InputSystem>() ?? gameObject.AddComponent <InputSystem>();
            inputSystem.Init(levelService);
            inputSystem.OnCharacterClicked += OnCharacterClicked;
            inputSystem.OnEmptyTileClicked += OnEmptyTileClicked;

            StartPlayerTurn();
        }