using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; public static class Const { public static GameObject LoadPrefab(string path,Vector3 pos,Vector3 rote,Vector3 scale) { GameObject go = Resources.Load(path); if (go != null) { go = GameObject.Instantiate(go, pos, Quaternion.Euler(rote)); go.transform.localScale = scale; return go; } return null; } public static GameObject LoadPrefab(string path) { GameObject go = Resources.Load(path); if (go != null) { go = GameObject.Instantiate(go); return go; } return null; } /// /// /// /// 多少秒 /// 委托 /// public static IEnumerator TimedTask(float time,Action action) { yield return new WaitForSeconds(time); action(); } public static void Domove(Transform trans,Vector3 pos,float time) { trans.DOMove(pos, time); } public static void DoRotate(Transform trans, Vector3 eulerAngles, float time) { trans.DORotate(eulerAngles, time); } }