Version: 2017.3

Image.fillClockwise

切换到手册
public bool fillClockwise ;

描述

应顺时针 (true) 还是逆时针 (false) 填充图像。

仅当 Image.type 设置为 Image.Type.Filled 并且 Image.fillMethod 设置为任意 Radial 方法时,这才会有效。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class FillClockwiseScript : MonoBehaviour { public Image healthCircle;

// This method sets the direction of the health circle. // Clockwise for the Player, Counter Clockwise for the opponent. void SetHealthDirection(GameObject target) { if (target.tag == "Player") { healthCircle.fillClockwise = true; } else if (target.tag == "Opponent") { healthCircle.fillClockwise = false; } } }