コード例 #1
0
ファイル: CutTeethEvent.cs プロジェクト: Tigerkim06/VRdentist
    public override void InitEvent()
    {
        base.InitEvent();
        bool foundTeeth   = SceneAssetManager.GetGameObjectAsset(wisdomTeethName, out wisdomTeeth);
        bool foundTrigger = SceneAssetManager.GetAssetComponent <CollisionTrigger>(wisdomTeethTriggerName, out wisdomTeethTrigger);
        bool foundItem    = SceneAssetManager.GetAssetComponent <GrabbableEquipmentBehavior>(toolName, out tool);
        bool foundText    = SceneAssetManager.GetAssetComponent <Text>(progressTextName, out progressText);

        fragmentTooth = new List <GameObject>();
        foreach (string targetName in fragmentTeethNames)
        {
            if (SceneAssetManager.GetGameObjectAsset(targetName, out GameObject targetObject))
            {
                targetObject.SetActive(false); // hide at begin
                fragmentTooth.Add(targetObject);
            }
        }

        Debug.Log("Found Asset[" + wisdomTeethName + "]: " + foundTeeth);
        Debug.Log("Found Asset[" + wisdomTeethTriggerName + "]: " + foundTrigger);
        Debug.Log("Found Asset[fragment Teeth]: " + (fragmentTooth.Count > 0));
        Debug.Log("Found Asset[" + toolName + "]: " + foundItem);
        Debug.Log("Found Asset[" + progressTextName + "]: " + foundText);

        if (wisdomTeeth)
        {
            wisdomTeeth.SetActive(true);
        }

        if (nextScene)
        {
            nextScene.InitEvent();
        }
    }