123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using System;
- using Fort23.Core;
- using Fort23.UTool;
- using UnityEngine;
- namespace Fort23.Mono
- {
- public class UIComponent : UIBase, IGObjectPoolInterface
- {
- private bool _isActivePool;
- public virtual async void Show()
- {
- await base.Show();
- }
- public virtual void Close()
- {
- }
- public string poolObjName { get; set; }
- public bool isUse { get; set; }
- public bool isDestroy { get; }
- public AssetHandle AssetHandle { get; set; }
- public TimerEntity DestroyTimer { get; set; }
- public GameObject own
- {
- get { return _own; }
- }
- private GameObject _own;
- public virtual void ResetData()
- {
- }
- /// <summary>
- /// 池子激活的时候
- /// </summary>
- public virtual void ActiveObj()
- {
- _isActivePool = true;
- own.SetActive(true);
- }
- /// <summary>
- /// 对方放回池子的时候
- /// </summary>
- public virtual void DormancyObj()
- {
- own.SetActive(false);
- if (!_isActivePool)
- {
- return;
- }
- DelEvent();
- }
- public void SetPosition(Vector3 pos)
- {
- #if !COMBAT_SERVER
- _own.transform.position = pos;
- #endif
- }
- public void SetScale(Vector3 scale)
- {
- #if !COMBAT_SERVER
- _own.transform.localScale = scale;
- #endif
- }
- public void SetRotation(Vector3 rotation)
- {
- #if !COMBAT_SERVER
- _own.transform.eulerAngles = rotation;
- #endif
- }
- public Vector3 GetPosition()
- {
- throw new System.NotImplementedException();
- }
- public Vector3 GetScale()
- {
- throw new System.NotImplementedException();
- }
- public Vector3 GettRotation()
- {
- throw new System.NotImplementedException();
- }
- public void SetActive(bool isActive)
- {
- #if !COMBAT_SERVER
- _own.SetActive(isActive);
- #endif
- }
- public async CTask DelayHide()
- {
- }
- /// <summary>
- /// 对象被销毁的时候
- /// </summary>
- public virtual void DestroyObj()
- {
- if (!_isActivePool)
- {
- return;
- }
- DelEvent();
- }
- public virtual void Preset()
- {
- }
- public virtual void AddEvent()
- {
- }
- public virtual void DelEvent()
- {
- }
- public void SetGameObject(GameObject gameObject)
- {
- _own = gameObject;
- }
-
- }
- }
|