Skip to content
This organization was marked as archived by an administrator on Aug 2, 2023. It is no longer maintained.
@MMA-Architecture

MMA

Organization with all the MMA's Modules

MMA Architecture

MMA is an architectural framework for managing communications that do not communicate directly with each other.

Setup:

  1. Add MMA with PackageManager or Sourcetree as Submodule.
  2. Add others modules (example => MMA.Scenes )
  3. implement the Symbol of keys in 'ProjectSettings>Player>OtherSettings>ScriptCompilation>ScriptingDefineSymbols => MMA_INT || MMA_STRING (MMA_STRING is better for prototyping and MMA_INT for a better performance, maybe in next releases will exist MMA_BYTE for best performance)

Quick start guide:

  1. Middleware is a class for pub/sub Action, Func, Coroutines, Task
  2. Module is used as a federated manager in a Scene to handle a specification
  3. Application works as a entity of a Module of the scene, these are GameObject/s, children of the Module GameObject

Easy Mode Example 'MMA_ATTRIBUTE' && 'MMA_STRING' && 'MMA_EXTENSOR_MIDDLEWARE'

using MMA;
public sealed partial class BootstrapModule : Module
{
    private void Start()  => "Bootstrap.Test".Invoke();
    [Subscribe("Bootstrap.Test")] private void OnTest() => "OnLog".Invoke(123);
    [Subscribe("OnLog")] private void OnLog(int value) => Debug.Log($"Hello World! {value}");
}

Performant Mode Example 'MMA_INT'

using MMA;
namespace Core.MenuHeaderUIModule {
  public sealed partial class MenuHeaderUIModule : Module {
    [SerializeField] private Text text_gold = default;
    protected override void OnSubscription(bool condition) => Middleware<float>.Subscribe_Publish(condition, Data.Key.OnChangeGold, OnChangeGold);
    private void OnChangeGold(float gold) => text_gold.text = gold.ToString();
  }
}
namespace Core.FakeModule{ //module to simulate the money obtention
  public sealed partial class FakeModule : Module {  
    protected override void OnSubscription(bool condition){}
    void Start() =>Service.Common.OnChangeGold(100)
  }
}
namespace Service { //Static classes to manage functions or implementations of Modules, it uses Data's Assembly reference
  public static Common {
      public static void OnChangeGold(float gold) => Middleware<float>.Invoke_Publish(Data.Key.OnChangeGold, gold);
  }
}
namespace Data { // Used to store the information used in this project (because is only useful for this project)
  public static Key {
    public const int OnChangeGold = Middleware.indexMethodCount++;
  }
}

Popular repositories

  1. .github .github Public archive

Repositories

Showing 1 of 1 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…