Unity3d MVCS游戏框架Robotlegs

最近在一个新项目中需要使用Robotlegs这套框架来重构代码

博主学习了下这套开源框架,还是很容易上手的

源码下载地址点击打开链接

博主学习了这套框架后也写了一个Demo

本文内容是围绕这个Demo来写的,大家可以下载参考Demo来学习点击打开链接

框架入口

using System.Collections;
using System.Collections.Generic;
using Robotlegs.Bender.Framework.API;
using Robotlegs.Bender.Framework.Impl;
using Robotlegs.Bender.Platforms.Unity.Bundles;
using Robotlegs.Bender.Platforms.Unity.Extensions.ContextViews.Impl;
using UnityEngine;

public class MyText : MonoBehaviour
{
	IContext context;

	public void Start()
	{
		context = new Context();

		context.Install<UnitySingleContextBundle>().Configure<MyTextConfig>().Configure(new TransformContextView(this.transform));
	}
}

Config

实例化框架后将安装配置信息
using System;
using System.Collections;
using System.Collections.Generic;
using Robotlegs.Bender.Extensions.EventCommand.API;
using Robotlegs.Bender.Extensions.Mediation.API;
using Robotlegs.Bender.Framework.API;
using UnityEngine;

public class MyTextConfig : IConfig
{
	[Inject]
	public IEventCommandMap eventCommandMap;
	[Inject]
	public IMediatorMap mediatorMap;
	[Inject]
	public IInjector injector;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值