private void AddPlayerToScene() { GameObject obj = Instantiate(Resources.Load("Prefabs/Models/enermy01")) as GameObject; ActorManager script = obj.AddComponent <ActorManager>(); this.EnermyList_.Add(script); }
public UIMovie() { InitializeComponent(); _directorService = new DirectorManager(new DirectorDal()); _movieService = new MovieManager(new MovieDal()); _actorService = new ActorManager(new ActorDal()); }
private void RefreshFromMetadata(MovieMetadata metadata) { Certification = metadata.Certification; FileInformation = metadata.FileInformation; Id = metadata.Id; OriginalTitle = metadata.OriginalTitle; Outline = metadata.Outline; PlayCount = metadata.PlayCount; Plot = metadata.Plot; PremieredDate = metadata.Premiered; Rating = metadata.Rating; RuntimeInMinutes = metadata.RuntimeInMinutes; Country = metadata.Country; SetName.Value = metadata.SetName; SetName.Save(); Studio = metadata.Studio; Tagline = metadata.Tagline; Title.Value = metadata.Title; Title.Save(); Year = metadata.Year; Poster.RefreshImage(metadata.ImagePosterPath); Fanart.RefreshImage(metadata.ImageFanartPath); Credits.ReplaceWith(metadata.Credits); Directors.ReplaceWith(metadata.Directors); Genres.ReplaceWith(metadata.Genres); ActorManager.Initialize(TransformActors(metadata.Actors)); }
/// <summary> /// Initializes a new instance of the <see cref="ActorUnitTestingRuntime"/> class. /// </summary> internal ActorUnitTestingRuntime(Configuration configuration, Type actorType, IRandomValueGenerator valueGenerator) : base(configuration, valueGenerator) { if (!actorType.IsSubclassOf(typeof(Actor))) { this.Assert(false, "Type '{0}' is not an actor.", actorType.FullName); } var id = new ActorId(actorType, null, this); this.Instance = ActorFactory.Create(actorType); IActorManager actorManager; if (this.Instance is StateMachine stateMachine) { actorManager = new StateMachineManager(this, stateMachine, Guid.Empty); } else { actorManager = new ActorManager(this, this.Instance, Guid.Empty); } this.ActorInbox = new EventQueue(actorManager); this.Instance.Configure(this, id, actorManager, this.ActorInbox); this.Instance.SetupEventHandlers(); this.LogWriter.LogCreateActor(this.Instance.Id, null, null); this.IsActorWaitingToReceiveEvent = false; }
public async Task GivenAutofac_WhenProxyCreated_ShouldPass() { IActorManager manager = new ActorManager(); var builder = new ContainerBuilder(); builder.RegisterType <StringCache>().As <ICache>(); builder.RegisterInstance(manager).As <IActorManager>(); IContainer container = builder.Build(); using (container.BeginLifetimeScope()) { manager.Register <ICache>(_ => container.Resolve <ICache>()); ActorKey key = new ActorKey("cache/test"); ICache cache = await manager.CreateProxy <ICache>(key); (await cache.GetCount()).Should().Be(1); await manager.Deactivate <ICache>(key); (await cache.GetCount()).Should().Be(2); } await manager.DeactivateAll(); }
public GameScene(GraphicsDevice graphicsDevice, ContentManager content, TileMap tileMap, Vector2 sceneryOffSet) { this.content = content; this.graphicsDevice = graphicsDevice; this.sceneryOffSet = sceneryOffSet; cameraManager = new CameraManager(); camera = new Camera(Vector2.Zero, new Vector2(this.Width, this.Height), new Vector2(50000, 50000)); this.tileMap = tileMap; this.tileMap.Camera = camera; actorManager = new ActorManager(); gateMapper = new ActorMapper(content, this.tileMap); actorManager.Reset(); player = new Actors.Player(actorManager, tileMap, camera, new Vector2(-100, -100), content.Load <Texture2D>(@"Textures/player"), 25.0f, 16, 16, 15, 15); chasingCamera = new ChasingCamera(player.location, camera, 2.0f); cameraManager.SetCameraScript(chasingCamera); IsCameraFree = false; this.weaponManager = new WeaponManager(); //cameraManager.AddCameraHandler(new Rotater(0.0f, MathHelper.PiOver2, 8)); cameraManager.AddCameraHandler(new Zoomer(1.0f, 1.0f, 0.5f, 0.01f)); UpdateRenderTarget(); this.sceneryOffSet = sceneryOffSet; PuzzleEngineAlpha.Resolution.ResolutionHandler.Changed += ResetSizes; this.tileMap.NewMap += NewMapHandling; particleManager = new ParticleManager(content, this.camera); }
public async Task ActorMultipleTest() { int count = 0; ActorManager manager = new ActorManager(); manager.Register <ICache>(_context, (c, x, m) => new StringCache(x, m, y => count += y)); ActorKey key1 = new ActorKey("Cache/Test1"); ICache cache1 = await manager.CreateProxyAsync <ICache>(_context, key1); count.Should().Be(1); ActorKey key2 = new ActorKey("Cache/Test2"); ICache cache2 = await manager.CreateProxyAsync <ICache>(_context, key2); count.Should().Be(2); await manager.DeactivateAsync <ICache>(_context, key1); count.Should().Be(1); await manager.DeactivateAsync <ICache>(_context, key2); count.Should().Be(0); await manager.DeactivateAllAsync(_context); }
private ActorManager GetSpawnableFromPool(string name) { ActorManager poolObject = null; // Find eligble object in pool for (var i = 0; i < _spawnablePool.Count && poolObject == null; i++) { if (!_spawnablePool[i].gameObject.activeInHierarchy && _spawnablePool[i].ActorName == name) { poolObject = _spawnablePool[i]; } } // No eligible object, expand the pool with a new one if (poolObject == null) { foreach (var actor in _knobs.spawnableObjectPrefabs) { if (actor.ActorName == name) { poolObject = InstantiateInPool(actor); break; } } } return(poolObject); }
protected virtual void Update() { if (transform.position.y < -1f) { ActorManager.DestroyActor(this); } }
static void Main(string[] args) { Console.WriteLine("!! Hello, start initialization..."); IRuleLibrary r = new RuleLibrary12Hour(); var dataManager = new DataManager(); var factory = new ActorFactory(dataManager.ActorProvider); var actorManager = new ActorManager(); actorManager.Initiate(dataManager.CurrencyProvider, dataManager.ActorProvider); while (true) { var command = Console.ReadLine(); if (command == "clear") { actorManager.ClearOldActorsData(); break; } if (command == "restart") { actorManager.ClearOldActorsData(); actorManager = new ActorManager(); actorManager.Initiate(dataManager.CurrencyProvider, dataManager.ActorProvider); } } // Console.WriteLine("Finished!!"); Console.ReadKey(); }
public SlimeActor(ActorManager actorManager, BasicActorConstruction basicActorConstruction) { _actorManager = actorManager; switch (basicActorConstruction.ActorConstructionType) { case BasicActorConstructionType.SlimeActive: _actionState = ActionState.SquishInPlace; _aiSwitchTimer = 120; Clipping = false; _renderVector.X = basicActorConstruction.X; _renderVector.Y = basicActorConstruction.Y; _textureClipping.X = 16; _textureClipping.Y = 0; _textureClipping.Width = 16; _textureClipping.Height = 16; TextureKey = TextureKey.Slime; X1 = basicActorConstruction.X + 4; X2 = basicActorConstruction.X + 12; Y1 = basicActorConstruction.Y + 8; Y2 = basicActorConstruction.Y + 16; break; default: throw new ActorConstructionTypeNotImplementedException("Slime actor does not implement " + basicActorConstruction.ActorConstructionType.ToString()); } }
} // end of XmlLevelData WriteToXml() protected GameActor ActorFromString(string actorName) { GameActor ret = null; var staticActor = ActorManager.GetActor(actorName); if (staticActor == null) { var splitName = actorName.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries); var nsQualName = splitName[0]; splitName = nsQualName.Split('.'); actorName = splitName[splitName.Length - 1]; staticActor = ActorManager.GetActor(actorName); } if (staticActor != null) { ret = ActorFactory.Create(staticActor); } else { Debug.Assert(false, "Why can't find the actor for: '" + actorName + "'!!"); } return(ret); }
/// <summary> /// Initializes a new instance of the class <see cref="MixedRealityExtensionApp"/> /// </summary> /// <param name="globalAppId">The global id of the app.</param> /// <param name="ownerScript">The owner mono behaviour script for the app.</param> internal MixedRealityExtensionApp(string globalAppId, MonoBehaviour ownerScript, IMRELogger logger = null) { GlobalAppId = globalAppId; _ownerScript = ownerScript; EventManager = new MWEventManager(this); _assetLoader = new AssetLoader(ownerScript, this); _userManager = new UserManager(this); _actorManager = new ActorManager(this); SoundManager = new SoundManager(this); _commandManager = new CommandManager(new Dictionary <Type, ICommandHandlerContext>() { { typeof(MixedRealityExtensionApp), this }, { typeof(Actor), null }, { typeof(AssetLoader), _assetLoader }, { typeof(ActorManager), _actorManager } }); RPC = new RPCInterface(this); RPCChannels = new RPCChannelInterface(); // RPC messages without a ChannelName will route to the "global" RPC handlers. RPCChannels.SetChannelHandler(null, RPC); #if ANDROID_DEBUG Logger = logger ?? new UnityLogger(this); #else Logger = logger ?? new ConsoleLogger(this); #endif }
public override async UniTask ExecuteAsync(CancellationToken cancellationToken = default) { await base.ExecuteAsync(cancellationToken); if (cancellationToken.CancelASAP) { return; } if (MakeDefault && !string.IsNullOrEmpty(AssignedId)) { ActorManager.DefaultPrinterId = AssignedId; } if (HideOther) { foreach (var printer in ActorManager.GetAllActors()) { if (printer.Id != AssignedId && printer.Visible) { printer.ChangeVisibilityAsync(false, Duration).Forget(); } } } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { floorTiles = Content.Load <Texture2D>("TempleFloor.png"); //playerTexture = Content.Load<Texture2D>("protagonistBodyAnimations"); playerTexture = Content.Load <Texture2D>("dreamManAnimations.png"); debugSquare = Content.Load <Texture2D>("debugSquare"); arielBlackFont = Content.Load <SpriteFont>("SpriteFont1"); device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(GraphicsDevice); origin.X = graphics.PreferredBackBufferWidth / 2; origin.Y = graphics.PreferredBackBufferHeight / 2; inputHandler = new InputHandler(origin); random = new Random(); tileRect = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); cam = new Camera(spriteBatch, tileRect, debugSquare); //actors = new List<Actor>(); aiController = new AIController(); actorController = new ActorController(); physicsController = new PhysicsController(); worldManager = new WorldManager(random); worldManager.initWorldConfig(Content, "content/Worlds.xml"); worldManager.initStartingWorld(); soundManager = new SoundManager(); soundManager.initSoundConfig(Content, "content/sfx/Sounds.xml"); actorManager = new ActorManager(); actorManager.initActorConfig(Content, "content/Actors.xml"); actorManager.spawnActors(worldManager.curWorld.getSpawns()); }
public Window(Game XnaGame, string Name) { _Name = Name; _Buffer = new Texture2D(XnaGame.GraphicsDevice, 2000, 2000); foreach (var t in XnaGame.Components) { if (t is Managers.WindowManager) { _WindowManager = (Managers.WindowManager)t; } else if (t is EdgeManager) { _EdgeManager = (EdgeManager)t; } else if (t is TextureManager) { _TextureManager = (TextureManager)t; } else if (t is ActorManager) { _ActorManager = (ActorManager)t; } } LoadXML(); }
public void RunService(int serverPort) { if (m_actorManager != null) { return; } m_actorManager = new ActorManager(); m_watchDogActor = new WatchDogActor(this); //Id为1的Actor, 不与Agent绑定,也没有U3DId标识 m_actorManager.AddActor(m_watchDogActor, true); m_worldActor = new WorldActor(this); m_watchDogActor.WorldActor = m_worldActor; //Id为2的Actor, 不与Agent绑定,也没有U3DId标识 m_actorManager.AddActor(m_worldActor, true); m_serverActor = new ServerActor(this); m_watchDogActor.ServerActor = m_serverActor; m_serverActor.WatchDogActor = m_watchDogActor; //Id为3的Actor, 不与Agent绑定,也没有U3DId标识 m_actorManager.AddActor(m_serverActor, true); //启动服务器 m_serverActor.Run(serverPort); }
public async Task ActorMethodTest() { int count = 0; ActorManager manager = new ActorManager(); manager.Register <ICache>(_ => new StringCache(y => count += y)); ActorKey key1 = new ActorKey("Cache/Test1"); ICache cache1 = await manager.CreateProxy <ICache>(key1); count.Should().Be(1); const string firstText = "first"; bool test = await cache1.IsCached(firstText); test.Should().BeFalse(); await cache1.Add(firstText); test = await cache1.IsCached(firstText); test.Should().BeTrue(); (await manager.Deactivate <ICache>(key1)).Should().BeTrue();; count.Should().Be(0); await manager.DeactivateAll(); }
public async Task ActorMultipleTest() { int count = 0; ActorManager manager = new ActorManager(); manager.Register <ICache>(_ => new StringCache(y => count += y)); ActorKey key1 = new ActorKey("Cache/Test1"); ICache cache1 = await manager.CreateProxy <ICache>(key1); count.Should().Be(1); ActorKey key2 = new ActorKey("Cache/Test2"); ICache cache2 = await manager.CreateProxy <ICache>(key2); count.Should().Be(2); (await manager.Deactivate <ICache>(key1)).Should().BeTrue(); count.Should().Be(1); (await manager.Deactivate <ICache>(key2)).Should().BeTrue(); count.Should().Be(0); await manager.DeactivateAll(); }
public async Task ActorProxyMultiTaskTest() { const int taskCount = 10; ActorManager manager = new ActorManager(); manager.Register <ICache>(_context, (context, k, m) => new StringCache(k, m)); var tasks = new List <Task>(); ActorKey key1 = new ActorKey("Cache/Test1"); CancellationTokenSource tokenSource = new CancellationTokenSource(); for (int i = 0; i < taskCount; i++) { Task t = Task.Run(() => TestAccess(manager, key1, tokenSource.Token)); tasks.Add(t); } await Task.Delay(TimeSpan.FromSeconds(10)); tokenSource.Cancel(); Task.WaitAll(tasks.ToArray()); (await manager.DeactivateAsync <ICache>(_context, key1)).Should().BeTrue(); }
protected void Start() { // Actor reg ActorManager.Register(this); // Nav init navMeshAgent = FindObjectOfType <NavMeshAgent>(); CommonUtil.IfNullLogError <NavMeshAgent>(navMeshAgent); // Patrol init patrolPath = GetComponent <PatrolPath>(); if (patrolPath != null) { patrolPath.owner = gameObject; // Init patrol navMeshAgent.SetDestination(patrolPath.GetNextTransform().position); } else if (patrolEnabled == false) { CommonUtil.IfNullLogError <PatrolPath>(patrolPath); } // Weapon init CommonUtil.IfNullLogError <GameObject>(weaponPrefab); weaponPrefab = Instantiate(weaponPrefab); weaponPrefab.transform.SetParent(transform); weaponData = weaponPrefab.GetComponent <BaseWeapon>(); weaponData.ownerIsPlayer = false; weaponData.owner = this; // Init state state = State.PATROL; }
public async Task GivenActor_WhenDeactivated_ShouldPass() { ActorManager manager = new ActorManager(); manager.Register <ICache>(_ => new StringCache()); ActorKey actorKey = new ActorKey("Cache/Test1"); ICache cache = await manager.CreateProxy <ICache>(actorKey); int count = await cache.GetCount(); count.Should().Be(1); await cache.TestAndDeactivate(_context); count = await cache.GetCount(); count.Should().Be(2); await cache.TestAndDeactivate(_context); count = await cache.GetCount(); count.Should().Be(4); }
//Hides the loading bar on start private void Start() { this.transform.localScale = new Vector3(0, 1, 1); actorManager = ActorManager.Instance; movieManager = MovieManager.Instance; loading = false; }
public bool DealDamge(ActorManager Enemyam, float damage, bool defenceVaild, bool counterVaild) { if (sm.isImmortal) { return(false); } if (sm.isCountBack) { if (sm.isCountBackSuccess && counterVaild) { Enemyam.Stunned(); am.im.overlapEcastms[0].active = true; return(false); } else { Hurt(damage, false); return(true); } } else if (sm.isDefence && defenceVaild) { am.Blocked(); am.sfxm.PlayShield(); return(false); } else { Hurt(damage, true); return(true); } }
public async Task ActorAutoFacActionSimpleTest() { IActorManager manager = new ActorManager(); var builder = new ContainerBuilder(); builder.RegisterType <StringCache>().As <ICache>(); builder.RegisterInstance(manager).As <IActorManager>(); IContainer container = builder.Build(); using (container.BeginLifetimeScope()) { manager.Register <ICache>(_context, (c, k, m) => { return(container.Resolve <ICache>(new TypedParameter(typeof(ActorKey), k))); }); ActorKey key = new ActorKey("cache/test"); ICache cache = await manager.CreateProxyAsync <ICache>(_context, key); (await cache.GetCount()).Should().Be(1); await manager.DeactivateAsync <ICache>(_context, key); (await cache.GetCount()).Should().Be(2); } await manager.DeactivateAllAsync(_context); }
protected override async Task SaveInternal() { Title.Save(); await ActorManager.Save(); TvShowMetadata metadata = CreateMetadata(); await _metadataService.Save(Path, metadata); }
public void SyncIsTransformedFromOthers() { if (ActorManager.IsMyActor(this)) { return; } SetIsTransformedFromOthers(); }
public void SyncAttack(Vector3 position) { if (ActorManager.IsMyActor(this)) { return; } m_gun.FireToSpecificPoint(position); }
public void SyncRoll(Vector3 direction) { if (ActorManager.IsMyActor(this)) { return; } Roll(direction); }
void Start() { delMnger = GameObject.FindObjectOfType <DelegationManager>(); actorMnger = GameObject.FindObjectOfType <ActorManager>(); // use the globale game event system to do something. // globalEventSystem.Quit += resetAssignments; }
// Instantiates an actor from the Resources/Actors folder with the name actor_name. // It then sets the object as a child of the Actors object in the canvas public static Actor Instantiate_Actor(string actor_name, ActorManager.Actor_Positions destination) { GameObject actor = Instantiate(Resources.Load("Actors/" + actor_name, typeof(GameObject))) as GameObject; Actor actor_script = actor.GetComponent<Actor>(); actor.transform.parent = GameObject.Find(VNProperties.canvas_name + "/Actors").transform; actor.transform.localScale = Vector3.one; actors_on_scene.Add(actor_script); // Add to list of actors return actor_script; }
// Instantly places the actor at the designated position public void Place_At_Position(ActorManager.Actor_Positions destination) { position = destination; RectTransform destination_pos = ActorManager.Get_Position(destination); RectTransform cur_pos = this.GetComponent<RectTransform>(); //cur_pos.position = destination_pos.position; cur_pos.offsetMin = new Vector2(destination_pos.offsetMin.x, destination_pos.offsetMin.y); cur_pos.offsetMax = new Vector2(destination_pos.offsetMax.x, destination_pos.offsetMin.y); }
void Awake() { actor_manager = this; left = left_; right = right_; actors_on_scene = new List<Actor>(); exiting_actors = new List<Actor>(); left_actors = new List<Actor>(); right_actors = new List<Actor>(); }
public GameManager(GraphicsDeviceManager graphics) { map = new Map(this); actorManager = new ActorManager<Actor>(this); bulletManager = new ActorManager<Projectile>(this); map.Load(); cam = new Camera(graphics); cam.pos.X += (map.CurrentRoom.XPos * 800) + 400; cam.pos.Y += (map.CurrentRoom.YPos * 480) + 180; camDestination = cam.pos; players.Add(new Player(new Vector2((map.CurrentRoom.XPos * 800) + 100, (map.CurrentRoom.YPos * 480) + 100), this)); }
public GameplayScreen(PlayRequest request) { mRequest = request; TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); mScene = null; mViews = new ObservableCollection<PlayerView>(); mActorMan = null; mScreenLayout = ViewportLayout.Invalid; mDrawSegments = new List<DrawSegment>(); mViewContentLoader = null; mPauseAlpha = 0.5f; mFrameCounter = 0; mFrameRate = 0; mFrameRateTimer = new TimeSpan(); mFrameTimes = new Queue<double>(); for (int f = 0; f < 30; ++f) { mFrameTimes.Enqueue(160.0d); } mPrevFrameTime = -1.0d; }
public override void UnloadContent() { mDrawSegments.Clear(); EffectRegistry.ClearRegistry(); mScene.Release(); GameResources.ActorManager.Release(); GameResources.ActorManager = null; GameResources.LoadNewLevelDelegate = null; while (mViews.Count > 0) { mViews[mViews.Count - 1].Unload(); mViews.Remove(mViews[mViews.Count - 1]); } mViewContentLoader.Unload(); mViewContentLoader.Dispose(); SharedResources.Game.GraphicsDevice.DeviceLost -= DeviceLostHandler; SharedResources.Game.GraphicsDevice.DeviceResetting -= DeviceResettingHandler; SharedResources.Game.GraphicsDevice.DeviceReset -= DeviceResetHandler; // Try to have all the big loaded objects garbage collected: mScene = null; mActorMan = null; System.GC.Collect(); }
public override void LoadContent() { mScene = new Scene(); mActorMan = new ActorManager(mViews); GameResources.ActorManager = mActorMan; LevelManifest manifest; using (ContentManager manifestLoader = new ContentManager(SharedResources.Game.Services, "Content")) { manifest = manifestLoader.Load<LevelManifest>(mRequest.LevelName); manifestLoader.Unload(); // a LevelManifest does not use any Disposable resources, so this is ok. } // The IScreenHoncho tells this gameplay screen how to set up the PlayerViews and DrawSegments required to play this level IScreenHoncho screenHoncho = Activator.CreateInstance(Type.GetType(manifest.ScreenHonchoTypeName)) as IScreenHoncho; mViewContentLoader = new ContentManager(SharedResources.Game.Services, "Content"); foreach (PlayerInfo player in GameResources.PlaySession.Players) { mViews.Add(PlayerViewFactory.Create(player, mRequest.CharacterSelections[player.PlayerId], screenHoncho, mViewContentLoader)); } // Determine screen layout and create DrawSegments if (screenHoncho.PlayersUseSeparateViewports) { switch (GameResources.PlaySession.LocalPlayers.Count) { case 1: mScreenLayout = ViewportLayout.FullScreen; break; case 2: mScreenLayout = GameOptions.PreferHorizontalSplit ? ViewportLayout.HorizontalSplit : ViewportLayout.VerticalSplit; break; case 3: case 4: mScreenLayout = ViewportLayout.FourWaySplit; break; default: throw new InvalidOperationException("Unsupported number of local players."); } foreach (int playerId in GameResources.PlaySession.LocalPlayers.Keys) { HumanView playerView = mViews.Single(v => v.PlayerId == playerId) as HumanView; ICameraProvider cameraPlayerView = playerView as ICameraProvider; if (cameraPlayerView == null) throw new LevelManifestException("When IScreenHoncho.PlayersUseSeparateViewports is true, HumanViews must implement the ICameraProvider interface."); DrawSegment ds = new DrawSegment(mScene, cameraPlayerView.Camera); mDrawSegments.Add(ds); playerView.DrawSegment = ds; } } else { mScreenLayout = ViewportLayout.FullScreen; DrawSegment ds = new DrawSegment(mScene); mDrawSegments.Add(ds); foreach (int playerId in GameResources.PlaySession.LocalPlayers.Keys) { HumanView playerView = mViews.Single(v => v.PlayerId == playerId) as HumanView; playerView.DrawSegment = ds; } } // TODO: P3: Make sure all non-local players are connected mScene.Load(); mActorMan.LoadContent(manifest); // TODO: P3: Make sure all remote clients have loaded their game. foreach (PlayerView view in mViews) { view.Load(); } GameResources.LoadNewLevelDelegate = LoadNewLevel; SharedResources.Game.GraphicsDevice.DeviceLost += DeviceLostHandler; SharedResources.Game.GraphicsDevice.DeviceResetting += DeviceResettingHandler; SharedResources.Game.GraphicsDevice.DeviceReset += DeviceResetHandler; }
public WorldScene(ActorManager actorManager) : base(actorManager) { }
public PvpScene(ActorManager actorManager) : base(actorManager) { }
void Start() { actor_manager = this; }
public MemoryGearScene(ActorManager actorManager) : base(actorManager) { }
public GuildBossScene(ActorManager actorManager) : base(actorManager) { }
// Use this for initialization void Start() { movementInputTimer = Time.fixedTime; options = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameOptions> (); worldMap = GameObject.FindGameObjectWithTag ("GameController").GetComponent<WorldMap> (); worldSound = GameObject.FindGameObjectWithTag ("GameController").GetComponent<WorldSound> (); move = gameObject.GetComponent<TileMovement>(); attack = gameObject.GetComponent<TileAttack>(); camera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Camera> (); actorManager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<ActorManager> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> (); ui = GameObject.FindGameObjectWithTag ("UIMain").GetComponent<UIMain> (); }
public KingRewardScene2(ActorManager actorManager) : base(actorManager) { }
/***************************************************************************************** *| GAME METHODS | COROUTINES | *****************************************************************************************/ IEnumerator PreBeginPlay( ) { //Debug while ( Application.loadedLevelName != MatchLevel ) { yield return null; } //Initiate the grid system GridSystem.InitializeGrid( ); //Initiate the actor manager ACTOR_MANAGER = gameObject.AddComponent<ActorManager>( ); ActorManager.Instance = ACTOR_MANAGER; //Initiate the phase manager PHASE_MANAGER = gameObject.AddComponent<PhaseManager>( ); while ( !GridSystem.IsInitialized ) { yield return null; } //All systems done, we're now in game and loaded CurrentGameState = GameState.GAME; bInputEnabled = false; GameObject waitingModal = ModalWindow.Display( "WaitingForPlayersPanel" ); while ( bInEvent ) { yield return null; } //Set as ready Hashtable readyProperties = new Hashtable( ) { {"Ready", true} }; PhotonNetwork.player.SetCustomProperties( readyProperties ); //On the server if ( PhotonNetwork.isMasterClient ) { //Wait until all players are ready while ( !AllPlayersReady ) yield return null; //Transfer actor ownership int baseNum = 0; foreach ( PhotonPlayer p in PhotonNetwork.playerList ) { PlayerBase baseToBeAssigned = PlayerBase.AllBases[ baseNum ]; if ( baseToBeAssigned != null ) { //Raise PhotonView assignment event byte evCode = 0; int[] content = new int[] { baseToBeAssigned.photonView.viewID, p.ID }; RaiseEventOptions op = new RaiseEventOptions( ); op.Receivers = ExitGames.Client.Photon.ReceiverGroup.All; PhotonNetwork.RaiseEvent( evCode, content, true, op ); baseNum++; } } //Once all players are ready, begin the game photonView.RPC( "RPCBeginGame", PhotonTargets.AllBuffered ); //Destroy the modal GameObject.Destroy( waitingModal.gameObject ); } else { //Wait until the game starts while ( !bGameStarted ) yield return null; } //Destroy the modal if ( waitingModal != null ) { GameObject.Destroy( waitingModal.gameObject ); } yield return null; }
public ArenaScene(ActorManager actorManager) : base(actorManager) { }
// Use this for initialization void Awake() { instance = this; actors = new List<Actor> (); }
public PillageScene(ActorManager actorManager) : base(actorManager) { }
void Awake() { actor_manager = this; left = left_; right = right_; }
public DefenseScene(ActorManager actorManager) : base(actorManager) { }
public BaseWorld(ActorManager actorManager) : base(actorManager) { }
public BaseScene(ActorManager actorManager) { this.actorMgr = actorManager; }
public StartScene(ActorManager actorManager) : base(actorManager) { }
// ------------------------------------------------------------------ // Desc: // ------------------------------------------------------------------ void Awake () { if( instance == null ) { instance = this; } }
// Setup public void SetupObjectReferences() { move = gameObject.GetComponent<TileMovement>(); attack = gameObject.GetComponent<TileAttack>(); worldMap = GameObject.FindGameObjectWithTag ("GameController").GetComponent<WorldMap> (); worldSound = GameObject.FindGameObjectWithTag ("GameController").GetComponent<WorldSound> (); ui = GameObject.FindGameObjectWithTag ("UIMain").GetComponent<UIMain> (); actorManager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<ActorManager> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> (); options = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameOptions> (); animationPosition = new Vector2(tileX*worldMap.mapTileSize,tileY*worldMap.mapTileSize); }
// Use this for initialization void Start() { console = gameObject.GetComponentInChildren<Console>(); camera = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Camera> (); worldMap = GameObject.FindGameObjectWithTag ("GameController").GetComponent<WorldMap> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player>(); playerInput = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerInput>(); actorManager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<ActorManager> (); GameObject clone; clone = Instantiate(selectionBox, gameObject.transform.position, gameObject.transform.rotation) as GameObject; selectionBox = clone; selectionBox.GetComponent<SpriteRenderer>().enabled = false; for(int l=0; l<=99; l++){ log[l] = ""; } ShowHideInventory(0); // Set inventory items on inventory menu for(int i=0;i<=9;i++){ inventoryItemsButtons[i] = inventoryItems[i].GetComponentInChildren<Button>(); inventoryItemsImages[i] = inventoryItems[i].GetComponentInChildren<Button>().GetComponentsInChildren<Image>()[1]; inventoryItemsImages[i].sprite = itemSpriteNone; //inventoryItemsPointers[i] = inventoryItems[i].GetComponentsInChildren<Image>()[3]; inventoryItemsLabels[i] = inventoryItems[i].GetComponentInChildren<Button>().GetComponentInChildren<Text>(); inventoryItemsLabels[i].text = "None"; //Debug.Log(inventoryItems[i].GetComponentInChildren<Button>().GetComponentInChildren<Image>()); } // Set player class titles playerClassTitles.Add("alchemist", "Alchemist"); playerClassTitles.Add("assasin", "Assasin"); playerClassTitles.Add("necromancer", "Necromancer"); playerClassTitles.Add("ranger", "Ranger"); playerClassTitles.Add("sellsword", "Sellsword"); // Set command titles commandTitles.Add("consume", "Consume"); commandTitles.Add("drop", "Drop"); commandTitles.Add("equip", "Equip/Remove"); commandTitles.Add("examine", "Examine"); commandTitles.Add("shoot", "Shoot"); commandTitles.Add("take", "Take"); commandTitles.Add("throw", "Throw"); // Set effect titles effectTitles.Add("evasion", "Evasion"); effectTitles.Add("healing", "Healing"); effectTitles.Add("poison", "Poison"); effectTitles.Add("stealth", "Stealth"); effectTitles.Add("strength", "Strength"); // Set popup sprites popupSpritesDict.Add("alert", 0); }
public TrialScene(ActorManager actorManager) : base(actorManager) { }