当前位置: 首页>>代码示例>>C#>>正文


C# GameObject.SetActiveRecursively方法代码示例

本文整理汇总了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));
 }
开发者ID:hdzprzluis,项目名称:itba-frogger,代码行数:7,代码来源:VehicleGenerator.cs

示例2: DisableBullet

 public void DisableBullet(GameObject bullet)
 {
     bullet.SetActiveRecursively(false);
     usedBullets.Remove(bullet);
     unUsedBullets.Add(bullet);
     BulletScript bulletscript = (BulletScript) bullet.GetComponent(typeof(BulletScript));
 }
开发者ID:yemel,项目名称:Unity-TP1,代码行数:7,代码来源:BulletManagerScript.cs

示例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
		}
开发者ID:watapax,项目名称:Antartica_AR,代码行数:7,代码来源:MB3_MBVersionConcrete.cs

示例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();
        }
    }
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:35,代码来源:StoreItemControllerDouble.cs

示例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
    }
开发者ID:tng2903,项目名称:game1,代码行数:21,代码来源:MadGameObject.cs

示例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);
        }
    }
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:32,代码来源:QuestCollectionMarkController.cs

示例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
 }
开发者ID:srivello,项目名称:JustLikeRabbits,代码行数:34,代码来源:DemoPart2.cs

示例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
 }
开发者ID:sudao2000,项目名称:kick.football.game,代码行数:9,代码来源:Torpedo.cs

示例9: SetVisible

	void SetVisible( GameObject obj, bool visible)
	{
		obj.SetActiveRecursively( visible);
		obj.active = visible;
		m_bVisible = visible;

		SetVisible_UserRebirth();
	}
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:8,代码来源:AsUserMenu.cs

示例10: OnLevelWasLoaded

    void OnLevelWasLoaded(int mapIndex)
    {
        if(mapIndex == 1) {
            GUI_Sound = GameObject.Find("GUI_Sound");
            GUI_Sound.SetActiveRecursively(false);

        }
    }
开发者ID:BBJV,项目名称:camachi,代码行数:8,代码来源:SoundSceneController.cs

示例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
    }
开发者ID:Ahere,项目名称:UnityIsometric,代码行数:11,代码来源:tk2dUIBaseItemControl.cs

示例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
    }
开发者ID:AtwoodDeng,项目名称:GGJ2015,代码行数:11,代码来源:tk2dUIBaseItemControl.cs

示例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
 }
开发者ID:funcodes,项目名称:AirGame,代码行数:9,代码来源:Obstacles.cs

示例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. ");
 }
开发者ID:olkeencole,项目名称:prefabtesting,代码行数:9,代码来源:GM.cs

示例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
 }
开发者ID:HaKDMoDz,项目名称:Capstone_Space_Game,代码行数:11,代码来源:SU_SpaceSceneSwitcher.cs


注:本文中的UnityEngine.GameObject.SetActiveRecursively方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。