/// <summary> /// 清除信息 /// </summary> public void Clean() { target = null; targetAmmoModule = null; targetHeadModule = null; previewImage.enabled = false; previewImage.sprite = null; }
/// <summary> /// 设置目标 /// </summary> /// <param name="target">目标部件</param> public override void SetTarget(ModuleBase target) { this.target = target; targetHeadModule = target as TankModuleHead; if (targetHeadModule == null) { return; } targetAmmoModule = headAmmoMap.GetAmmo(targetHeadModule); if (!targetAmmoModule) { Clean(); return; } previewImage.sprite = targetAmmoModule.preview; previewImage.enabled = true; }