示例#1
0
        void CreateAudio()
        {
            DaggerfallActionDoor[] actionDoors = FindObjectsOfType <DaggerfallActionDoor>();

            if (actionDoors != null)
            {
                foreach (DaggerfallActionDoor actionDoor in actionDoors)
                {
                    string meshFilterName = actionDoor.GetComponent <MeshFilter>().name;

                    if (!meshFilterName.Contains("55000") && !meshFilterName.Contains("55001") && !meshFilterName.Contains("55002") && !meshFilterName.Contains("55003") &&
                        !meshFilterName.Contains("55004") && !meshFilterName.Contains("55005"))
                    {
                        // Secret door

                        SecretDoorAudioParent parent = actionDoor.gameObject.AddComponent <SecretDoorAudioParent>();
                        parent.Initialize(minDist, maxDist, volume, pitch);
                    }
                }
            }
        }
示例#2
0
 private void Awake()
 {
     actionDoor = GetComponentInParent <DaggerfallActionDoor>();
     parent     = GetComponentInParent <SecretDoorAudioParent>();
 }