Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#-设置活动不工作?_C#_Unity3d_Activation_Gameobject - Fatal编程技术网

C#-设置活动不工作?

C#-设置活动不工作?,c#,unity3d,activation,gameobject,C#,Unity3d,Activation,Gameobject,有人能告诉我为什么我的游戏对象不能再次激活吗 谢谢 C#代码 using UnityEngine; using System.Collections; public class SlowerPowerUP : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () {

有人能告诉我为什么我的游戏对象不能再次激活吗

谢谢

C#代码

using UnityEngine;
using System.Collections;

public class SlowerPowerUP : MonoBehaviour {

    // Use this for initialization
    void Start () {
    }

    // Update is called once per frame
    void Update () {
        if (BirdMovement.CountFS > 300) {
            gameObject.SetActive(true);
        } 
        else {
            gameObject.SetActive(false);
        }
    }
}

停用的对象未接收unity事件(更新、修复更新等)。所以
gameObject.SetActive(true)将不会被调用

当你给我的问题评分为负数时,请告诉我为什么?!您需要添加更多相关代码,缺少的代码太多。请提供预期行为、运行程序时的任何错误消息以及与问题相关的所有代码。如果有很多代码,请将其发布到gist或pastebin文件中。