public void OnEnable() { //Manifest that defines what the SO uses from Machinations. Manifest = new MnObjectManifest { Name = "Sound Event", DiagramMappings = new List <DiagramMapping> { new DiagramMapping { PropertyName = M_MAX_SOUND_HIGH_HEALTH, DiagramElementID = 250, DefaultElementBase = new ElementBase(4, null), OverrideElementBase = new ElementBase(4, null) }, new DiagramMapping { PropertyName = M_MAX_SOUND_LOW_HEALTH, DiagramElementID = 251, DefaultElementBase = new ElementBase(6, null), OverrideElementBase = new ElementBase(6, null) } }, CommonStatesAssociations = new List <StatesAssociation> { new StatesAssociation("Exploring", new List <GameStates>() { GameStates.Exploring }) } }; //Register this SO with the MDL. MnDataLayer.EnrollScriptableObject(this, Manifest); }
public void OnEnable() { //Manifest that defines what the Scriptable Object uses from Machinations. Manifest = new MnObjectManifest() { Name = "Rectangle's Properties", DiagramMappings = new List <DiagramMapping> { new DiagramMapping { EditorElementBase = MovementSpeed, PropertyName = M_MOVEMENTSPEED, DiagramElementID = 102, DefaultElementBase = new ElementBase(15, null) }, new DiagramMapping { EditorElementBase = ChangeDirectionTime, PropertyName = M_CHANGE_DIRECTION_TIME, DiagramElementID = 2100, DefaultElementBase = new ElementBase(50, null) }, new DiagramMapping { EditorElementBase = SizeX, PropertyName = M_SIZEX, DiagramElementID = 103, DefaultElementBase = new ElementBase(3, null) }, new DiagramMapping { EditorElementBase = SizeY, PropertyName = M_SIZEY, DiagramElementID = 201, DefaultElementBase = new ElementBase(50, null) }, new DiagramMapping { PropertyName = M_SIZEZ, DiagramElementID = 14000, EditorElementBase = SizeZ } } }; //Register this Scriptable Object with the MDL. //MnDataLayer.EnrollScriptableObject(this, Manifest); }
/// <summary> /// Default constructor. /// </summary> /// <param name="manifest">The Manifest that will be used to initialized this MachinationsGameObject.</param> /// <param name="onBindersUpdated">When a <see cref="MnGameObject"/> enrolls itself /// using <see cref="MnDataLayer.EnrollGameObject"/>, this event WILL fire if the MachinationsDataLayer /// has been initialized. So, this is why it is allowed to send an EventHandler callback upon Construction. /// </param> public MnGameObject(MnObjectManifest manifest, EventHandler onBindersUpdated = null) { _name = manifest.Name; _manifest = manifest; foreach (DiagramMapping diagramMapping in _manifest.DiagramMappings) { CreateBinder(diagramMapping); } //Assign event, if any was provided. This has to be done before EnrollGameObject, because that function //may call MGLInitComplete, which may in turn call OnBindersUpdated. if (onBindersUpdated != null) { OnBindersUpdated = onBindersUpdated; } MnDataLayer.EnrollGameObject(this); }
public void OnEnable() { //Manifest that defines what the SO uses from Machinations. Manifest = new MnObjectManifest { Name = "Enemy Tank Stats", DiagramMappings = new List <DiagramMapping> { new DiagramMapping { EditorElementBase = Health, PropertyName = M_HEALTH, DiagramElementID = 8920, DefaultElementBase = new ElementBase(105, null) }, new DiagramMapping { EditorElementBase = Speed, PropertyName = M_SPEED, DiagramElementID = 8917, DefaultElementBase = new ElementBase(25, null) }, //BUFFS. new DiagramMapping { EditorElementBase = HealthBuff, PropertyName = M_HEALTH_BUFF, DiagramElementID = 9120, DefaultElementBase = new ElementBase(25, null) }, new DiagramMapping { EditorElementBase = SpeedBuff, PropertyName = M_SPEED_BUFF, DiagramElementID = 9301, DefaultElementBase = new ElementBase(10, null) } } }; //Register this SO with the MDL. MnDataLayer.EnrollScriptableObject(this, Manifest); }
/// <summary> /// Default constructor. /// </summary> /// <param name="manifest">The Manifest that will be used to initialized this MachinationsGameAwareObject.</param> /// <param name="onBindersUpdated">When a <see cref="MnGameObject"/> enrolls itself /// using <see cref="MnDataLayer.EnrollGameObject"/>, this event WILL fire if the MachinationsDataLayer /// has been initialized. So, this is why it is allowed to send an EventHandler callback upon Construction. /// </param> public MnGameAwareObject(MnObjectManifest manifest, EventHandler onBindersUpdated = null) : base(manifest, onBindersUpdated) { }
public void OnEnable() { //Manifest that defines what the SO uses from Machinations. Manifest = new MnObjectManifest { Name = "Drop Ratios", DiagramMappings = new List <DiagramMapping> { new DiagramMapping { EditorElementBase = EnemyLifeBuffWeight, PropertyName = M_ENEMY_LIFE_BUFF_WEIGHT, DiagramElementID = 9135, DefaultElementBase = new ElementBase(200, null) }, new DiagramMapping { EditorElementBase = ExplosionForceBuffWeight, PropertyName = M_EXPLOSION_FORCE_BUFF_WEIGHT, DiagramElementID = 9136, DefaultElementBase = new ElementBase(100, null) }, new DiagramMapping { EditorElementBase = ExplosionRadiusBuffWeight, PropertyName = M_EXPLOSION_RADIUS_BUFF_WEIGHT, DiagramElementID = 9137, DefaultElementBase = new ElementBase(100, null) }, new DiagramMapping { EditorElementBase = EnemyCooldownBuffWeight, PropertyName = M_ENEMY_COOLDOWN_BUFF_WEIGHT, DiagramElementID = 9139, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = EnemyDamageBuffWeight, PropertyName = M_ENEMY_DAMAGE_BUFF_WEIGHT, DiagramElementID = 9138, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = PlayerCooldownBuffWeight, PropertyName = M_PLAYER_COOLDOWN_BUFF_WEIGHT, DiagramElementID = 9127, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = PlayerProjectileSpeedBuffWeight, PropertyName = M_PLAYER_PROJECTILE_SPEED_BUFF_WEIGHT, DiagramElementID = 9049, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = PlayerSpeedBuffWeight, PropertyName = M_PLAYER_SPEED_BUFF_WEIGHT, DiagramElementID = 9051, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = PlayerLifeBuffWeight, PropertyName = M_PLAYER_LIFE_BUFF_WEIGHT, DiagramElementID = 9131, DefaultElementBase = new ElementBase(1, null) }, new DiagramMapping { EditorElementBase = EnemySpeedBuffWeight, PropertyName = M_ENEMY_SPEED_BUFF_WEIGHT, DiagramElementID = 9304, DefaultElementBase = new ElementBase(1, null) } } }; //Register this SO with the MDL. MnDataLayer.EnrollScriptableObject(this, Manifest); UpdateDropRates(); }
public void OnEnable() { //Manifest that defines what the SO uses from Machinations. Manifest = new MnObjectManifest { Name = "Shell Stats", DiagramMappings = new List <DiagramMapping> { new DiagramMapping { EditorElementBase = Damage, PropertyName = M_DAMAGE, DiagramElementID = 8907, DefaultElementBase = new ElementBase(10, null) }, new DiagramMapping { EditorElementBase = Radius, PropertyName = M_RADIUS, DiagramElementID = 8905, DefaultElementBase = new ElementBase(25, null) }, new DiagramMapping { EditorElementBase = Force, PropertyName = M_FORCE, DiagramElementID = 8904, DefaultElementBase = new ElementBase(90, null) }, new DiagramMapping { EditorElementBase = Speed, PropertyName = M_SPEED, DiagramElementID = 8906, DefaultElementBase = new ElementBase(90, null) }, new DiagramMapping { EditorElementBase = ShotCooldown, PropertyName = M_COOLDOWN, DiagramElementID = 8909, DefaultElementBase = new ElementBase(0, null) }, //BUFFS. new DiagramMapping { EditorElementBase = ShotCooldownBuff, PropertyName = M_COOLDOWN_BUFF, DiagramElementID = 9130, DefaultElementBase = new ElementBase(0, null) }, new DiagramMapping { EditorElementBase = ExplosionForceBuff, PropertyName = M_EXPLOSION_FORCE_BUFF, DiagramElementID = 9237, CrossManifestName = "ExplosionForce", DefaultElementBase = new ElementBase(0, null) }, new DiagramMapping { EditorElementBase = ExplosionRadiusBuff, PropertyName = M_EXPLOSION_RADIUS_BUFF, DiagramElementID = 9238, CrossManifestName = "ExplosionRadius", DefaultElementBase = new ElementBase(0, null) }, new DiagramMapping { EditorElementBase = ShellSpeedBuff, PropertyName = M_SHELL_SPEED_BUFF, DiagramElementID = 9032, DefaultElementBase = new ElementBase(0, null) } } }; //Register this SO with the MDL. MnDataLayer.EnrollScriptableObject(this, Manifest); }