CTT/Unity/Assets/Editor/Assistent/Misc/ScriptTemplate.cs

343 lines
4.8 KiB
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ETEditor
{
public class ScriptTemplate
{
public const string Entity =
@"using System;
using ;
namespace
{
public class AwakeSystem : AwakeSystem<>
{
public override void Awake( self)
{
self.Awake();
}
}
public class StartSystem : StartSystem<>
{
public override void Start( self)
{
self.Start();
}
}
public class UpdateSystem : UpdateSystem<>
{
public override void Update( self)
{
self.Update();
}
}
public class DestroySystem : DestroySystem<>
{
public override void Destroy( self)
{
self.Destroy();
}
}
public class : Entity
{
public void Awake()
{
}
public void Start()
{
}
public void Update()
{
}
public void Destroy()
{
}
}
}";
public const string UnitEntity =
@"using System;
using ;
using UnityEngine;
namespace
{
public class AwakeSystem : AwakeSystem<, GameObject>
{
public override void Awake( self, GameObject go)
{
self.Awake(go);
}
}
public class StartSystem : StartSystem<>
{
public override void Start( self)
{
self.Start();
}
}
public class UpdateSystem : UpdateSystem<>
{
public override void Update( self)
{
self.Update();
}
}
public class DestroySystem : DestroySystem<>
{
public override void Destroy( self)
{
self.Destroy();
}
}
[HideInHierarchy]
public class : Entity
{
public void Awake(GameObject go)
{
ViewGO = go;
ViewGO.AddComponent<ComponentView>().Component = this;
}
public void Start()
{
}
public void Update()
{
}
public void Destroy()
{
}
}
}";
public const string Normal =
@"using System;
using ;
namespace
{
public class
{
}
}";
public const string UIScript =
@"using System;
using ET;
using UnityEngine;
using UnityEngine.UI;
namespace ET
{
public class AwakeSystem : AwakeSystem<>
{
public override void Awake( self)
{
self.Awake();
}
}
public class StartSystem : StartSystem<>
{
public override void Start( self)
{
self.Start();
}
}
public class UpdateSystem : UpdateSystem<>
{
public override void Update( self)
{
self.Update();
}
}
public class DestroySystem : DestroySystem<>
{
public override void Destroy( self)
{
self.Destroy();
}
}
public partial class : Entity
{
public void Awake()
{
GetReference();
}
public void Start()
{
}
public void Update()
{
}
public void Destroy()
{
}
}
}";
public const string UIReference =
@"using System;
using ET;
using UnityEngine;
using UnityEngine.UI;
namespace ET
{
public partial class
{
public ReferenceCollector Collector;
public void GetReference()
{
Collector = GetParent<UI>().ViewGO.GetComponent<ReferenceCollector>();
}
}
}";
public const string UIType =
@"using System;
namespace ET
{
public static class UIType
{
}
}";
public const string AEvent =
@"using 另一个命名空间;
namespace
{
[OldEvent(EventIdType.事件类型)]
public class : AEvent
{
public override void Run()
{
}
}
}";
public const string EventIdType =
@"namespace 命名空间
{
public static class EventIdType
{
}
}";
public const string AMRpcHanler =
@"using System;
using System.Net;
using ET;
namespace ET
{
[MessageHandler]
public class Handler : AMRpcHandler<, >
{
protected override async ETTask Run(Session session, request, response, Action reply)
{
reply();
}
}
}";
public const string AMHandler =
@"using ET;
namespace ET
{
[MessageHandler]
public class Handler : AMHandler<>
{
protected override async ETTask Run(ET.Session session, message)
{
await ETTask.CompletedTask;
}
}
}";
public const string ET6AMRpcHanler =
@"using System;
namespace ET
{
[ActorMessageHandler]
public class Handler : AMActorLocationRpcHandler<Unit, , >
{
protected override async ETTask Run(Unit unit, request, response, Action reply)
{
reply();
await ETTask.CompletedTask;
}
}
}";
public const string ET6AMHandler =
@"
namespace ET
{
[ActorMessageHandler]
public class Handler : AMActorHandler<>
{
protected override async ETTask Run(Session session, message)
{
await ETTask.CompletedTask;
}
}
}";
}
}