private void Start() { gameApi = ApiProvider.ProvideGameApi(); gameApi.SceneEntered += OnSceneEntered; gameApi.GameObjectsAdded += OnGameObjectsAdded; gameApi.GameObjectsRemoved += OnGameObjectsRemoved; }
private void CreateDummyEntities() { var gameApi = ApiProvider.ProvideGameApi(); gameApi.GameObjectsAdded.Invoke(new GameObjectsAddedMessage() { GameObjects = dummyEntities.Select(x => new GameObjectData() { Id = x.Id, Name = x.Type.ToString(), X = x.Position.x, Y = x.Position.y, Direction = 0, CharacterName = string.Empty, CharacterClass = 0, HasCharacter = false }).ToArray(), }); }
private void CreateLocalDummyEntity() { var userName = UserData.CharacterData.Name; if (userName == null) { userName = dummyCharacter.CharacterName; } var userCharacterType = UserData.CharacterData.Type; if (userCharacterType == -1) { userCharacterType = (byte)dummyCharacter.CharacterClass; } var message = new EnteredSceneMessage() { GameObjectId = dummyCharacter.DummyEntity.Id, X = dummyCharacter.DummyEntity.Position.x, Y = dummyCharacter.DummyEntity.Position.y, CharacterName = userName, CharacterClass = (byte)userCharacterType }; var direction = dummyCharacter.DummyEntity.Direction; if (direction == Player.Direction.Left) { message.Direction = 1; } else { message.Direction = -1; } var gameApi = ApiProvider.ProvideGameApi(); gameApi.SceneEntered.Invoke(message); }
private void Awake() { gameApi = ApiProvider.ProvideGameApi(); gameApi.Connected += OnConnected; }
private void Awake() { gameApi = ApiProvider.ProvideGameApi(); gameApi.SceneChanged += OnSceneChanged; }
private void Start() { gameApi = ApiProvider.ProvideGameApi(); gameApi.PositionChanged += OnPositionChanged; }
private void Start() { gameApi = ApiProvider.ProvideGameApi(); }
private void Start() { gameApi = ApiProvider.ProvideGameApi(); gameApi.Attacked += OnPlayerAttacked; }
private void Start() { gameApi = ApiProvider.ProvideGameApi(); gameApi.BubbleMessageReceived += OnBubbleMessageReceived; }