/// <summary> /// Create a new renderer for the given entity /// </summary> /// <param name="entity">Entity for which the renderer will be created</param> private void CreateEntity(IMap map, Entity entity, bool isPlayer) { GameObject instance = Instantiate(entityPrefab, Vector3.zero, Quaternion.identity); EntityActor actor = instance.AddComponent( isPlayer ? typeof(PlayerActor) : typeof(AIActor) ) as EntityActor; actor.Init(map, entity); instance.transform.parent = transform; EntityRenderer renderer = instance.GetComponent <EntityRenderer>(); renderer.Init(entity); }
public static void Initialize( ) { ColorProgram.Init( ); MatrixProgram.Init( ); FBOProgram.Init( ); GaussianBlurProgram.Init( ); DarkenProgram.Init( ); UIAbilityIconProgram.Init( ); LineProgram.Init( ); //LightManager.Init( ); UIRenderer.SharedRenderer = new UIRenderer(Assets.GetSprite("interface")); EntityRenderer.Init( ); #if __ANDROID__ State = new LocalCopyState(new AndroidDatabaseProvider((Android.App.Activity)Assets.Context)); #endif Screen.MainMenu.Load( ); Screen.Active = Screen.MainMenu; Window.Background = new Color(225, 225, 225, 255); }