public override void Initialize(NPCData npcData, Vector3 pos, Action initOK = null) { base.Initialize(npcData, pos, initOK); roleData = configMgr.GetRoleData(npcData.roleid); var id = npcData.roleid.ToString(); base.CreateNpcObject(id, pos, roleData.scale, delegate(GameObject prefab) { swf = roleObject.GetComponent <CSwf>(); swf.onStopPlayingEvent += OnPlayingClipOK; render = roleObject.GetComponent <MeshRenderer>(); swfClip = roleObject.GetComponent <SwfClip>(); gameObject.SetActive(false); gameObject.transform.position = pos; if (initOK != null) { initOK(); } }); }
void Awake() { swfClip = GetComponent <SwfClip>(); swfClip.sortingOrder = AppConst.RoleSortLayer; swfCtrl = GetComponent <SwfClipController>(); swfCtrl.autoPlay = false; }
// --------------------------------------------------------------------- // // Outdated assets // // --------------------------------------------------------------------- public static bool CheckForOutdatedAsset(SwfClip clip) { return(clip && CheckForOutdatedAsset(clip.clip)); }