本文整理汇总了C#中UnityEngine.GameObject.SetActiveRecursively方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.SetActiveRecursively方法的具体用法?C# GameObject.SetActiveRecursively怎么用?C# GameObject.SetActiveRecursively使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.GameObject
的用法示例。
在下文中一共展示了GameObject.SetActiveRecursively方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DestroyObject
public void DestroyObject(GameObject vehicle)
{
vehicle.SetActiveRecursively(false);
pool.Add(vehicle);
vehiculesInStreet.Remove(vehicle);
//Debug.Log(string.Format("Eliminando {0}", vehicle.tag));
}
示例2: DisableBullet
public void DisableBullet(GameObject bullet)
{
bullet.SetActiveRecursively(false);
usedBullets.Remove(bullet);
unUsedBullets.Add(bullet);
BulletScript bulletscript = (BulletScript) bullet.GetComponent(typeof(BulletScript));
}
示例3: SetActiveRecursively
public void SetActiveRecursively(GameObject go, bool isActive){
#if UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5
go.SetActiveRecursively(isActive);
#else
go.SetActive(isActive);
#endif
}
示例4: SetFocus
//public void SetDownSlotVisible(bool _visible)
//{
// if (slotDown != null)
// {
// slotDown.SetActiveRecursively(_visible);
// bDisableSlotDown = !_visible;
// }
//}
public void SetFocus(GameObject _focusObject, StoreTouchInfo _touchInfo)
{
if (_touchInfo == null)
return;
StoreItemControllerInfo selectItem = null;
_focusObject.SetActiveRecursively(true);
SimpleSprite sprite = _focusObject.GetComponent<SimpleSprite>();
sprite.Unclip();
if (_touchInfo.type == StoreTouchType.STORE_TOUCH_LEFT)
selectItem = itemUp;
else if (_touchInfo.type == StoreTouchType.STORE_TOUCH_RIGHT)
selectItem = itemDown;
if (selectItem != null)
{
selectItem.itemFocusObject = _focusObject;
_focusObject.transform.parent = selectItem.itemSlotSprite.transform;
_focusObject.transform.localPosition = new Vector3(0.0f, 0.0f, -2.0f);
selectItem.uiListItemContainer.ScanChildren();
}
}
示例5: SetActive
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
// ===========================================================
// Static Methods
// ===========================================================
// activation methods because method how unity handles object activation changed in 4.0
public static void SetActive(GameObject go, bool active) {
#if UNITY_3_5
go.SetActiveRecursively(active);
#else
go.SetActive(active);
#endif
}
示例6: Init
public void Init(int _npcID, AsPanel_Name _namePanel, AsBaseEntity _entity)
{
npcID = _npcID;
panelName = _namePanel;
Transform tmDummyTop = ResourceLoad.SearchHierarchyTransform(transform, "DummyLeadTop");
markObj = ResourceLoad.CreateGameObject("UseScript/Object/Exclamation_Blue");
if (markObj != null)
{
if (tmDummyTop != null)
{
markObj.transform.position = tmDummyTop.transform.position;
markObj.transform.parent = transform;
}
else
{
if( true == _entity.isKeepDummyObj)
{
Vector3 vPos = _entity.transform.position;
vPos.y += _entity.characterController.height;
markObj.transform.position = vPos;
markObj.transform.parent = _entity.transform;
}
else
Debug.Log("dummy is null");
}
markObj.SetActiveRecursively(false);
}
}
示例7: ActivatePart
void ActivatePart(GameObject partX)
{
#if UNITY_3_4 || UNITY_3_5
if(part1.active)
part1.SetActiveRecursively(false);
if(part2.active)
part2.SetActiveRecursively(false);
if(part3.active)
part3.SetActiveRecursively(false);
if(part4.active)
part4.SetActiveRecursively(false);
if(part5.active)
part5.SetActiveRecursively(false);
if(part6.active)
part6.SetActiveRecursively(false);
if(partX != null)
partX.SetActiveRecursively(true);
#else
if(part1.activeSelf)
part1.SetActive(false);
if(part2.activeSelf)
part2.SetActive(false);
if(part3.activeSelf)
part3.SetActive(false);
if(part4.activeSelf)
part4.SetActive(false);
if(part5.activeSelf)
part5.SetActive(false);
if(part6.activeSelf)
part6.SetActive(false);
if(partX != null)
partX.SetActive(true);
#endif
}
示例8: EnableDisable
//Enables/disables the object with childs based on platform
void EnableDisable(GameObject what, bool childs)
{
#if UNITY_3_5
what.SetActiveRecursively(childs);
#else
what.SetActive(childs);
#endif
}
示例9: SetVisible
void SetVisible( GameObject obj, bool visible)
{
obj.SetActiveRecursively( visible);
obj.active = visible;
m_bVisible = visible;
SetVisible_UserRebirth();
}
示例10: OnLevelWasLoaded
void OnLevelWasLoaded(int mapIndex)
{
if(mapIndex == 1) {
GUI_Sound = GameObject.Find("GUI_Sound");
GUI_Sound.SetActiveRecursively(false);
}
}
示例11: ChangeGameObjectActiveState
/// <summary>
/// Used for SetActive so easily works between Unity 3.x and Unity 4.x
/// </summary>
public static void ChangeGameObjectActiveState(GameObject go, bool isActive)
{
#if UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9
go.SetActiveRecursively(isActive);
#else
go.SetActive(isActive);
#endif
}
示例12: ChangeGameObjectActiveState
/// <summary>
/// Used for SetActive so easily works between Unity 3.x and Unity 4.x
/// </summary>
public static void ChangeGameObjectActiveState(GameObject go, bool isActive)
{
#if UNITY_3_5
go.SetActiveRecursively(isActive);
#else
go.SetActive(isActive);
#endif
}
示例13: EnableDisable
//Enables/disables the object with childs based on platform
void EnableDisable(GameObject what, bool activate)
{
#if UNITY_3_5
what.SetActiveRecursively(activate);
#else
what.SetActive(activate);
#endif
}
示例14: Start
public void Start()
{
string r = progress.ToString();
string k = goal.ToString();
score = r + " / " + k;
player = GameObject.FindWithTag("Player") ;
player.SetActiveRecursively(false);
Narrator.narrate("The yawning abyss.\n Chaos. When nothing existed. ");
}
示例15: SetActive
// Since SetActiveRecursively has been deprecated this function performs game object
// activation correctly based regardless of Unity version.
public static void SetActive(GameObject _gameObject, bool _bool)
{
#if UNITY_3_5
if (_gameObject != null) _gameObject.SetActiveRecursively(_bool);
#endif
#if UNITY_4_0
if (_gameObject != null) _gameObject.SetActive(_bool);
#endif
}