Example #1
0
        public void OnStart()
        {
            if (animator == null || animator!=GameObjectAnimatorCollectionConverter.getAnimator(doorAnimator))
                        animator = GameObjectAnimatorCollectionConverter.getAnimator(doorAnimator);

                    if (sound == null)
                        sound = DoorSoundDataCollectionConverter.getData(soundData);
        }
Example #2
0
 public static IDoorSoundData getInstance()
 {
     if(instance == null)
         instance = new DefaultDoorSoundData();
     return instance;
 }
Example #3
0
        void Start()
        {
            doorName = CLang.getInstance().get(idName);
            doorCaption = CLang.getInstance().get(idCaption);

            if (gameObject.layer != 0)
                gameObject.layer = 0;

            audioSource = gameObject.GetComponent<AudioSource>();

            if (audioSource==null)
                audioSource = gameObject.AddComponent<AudioSource>();

            Rigidbody body = gameObject.GetComponent<Rigidbody>();

            if(body==null)
                body = gameObject.AddComponent<Rigidbody>();

            body.useGravity  = false;
            body.isKinematic = true;

            BoxCollider boxCollider = gameObject.GetComponent<BoxCollider>();
            if(boxCollider==null)
                boxCollider = gameObject.AddComponent<BoxCollider>();

            animator = GameObjectAnimatorCollectionConverter.getAnimator(doorAnimator);
            sound = DoorSoundDataCollectionConverter.getData(soundData);
        }