コード例 #1
0
ファイル: HVRStabbable.cs プロジェクト: CeMSIM/CeMSIM-ORSim
        void Awake()
        {
            if (!Settings)
            {
                Settings = ScriptableObject.CreateInstance <HVRStabbableSettings>();
            }

            Settings.CheckCurve();
            Stabbers = new List <HVRStabber>();
        }
コード例 #2
0
        public void Start()
        {
            Rigidbody = GetComponent <Rigidbody>();

            if (StabAnything && !FallbackSettings)
            {
                FallbackSettings = ScriptableObject.CreateInstance <HVRStabbableSettings>();
            }

            if (FallbackSettings)
            {
                FallbackSettings.CheckCurve();
            }

            if (CollidersToIgnore == null || CollidersToIgnore.Length == 0)
            {
                CollidersToIgnore = GetComponentsInChildren <Collider>();
            }

            if (!Settings)
            {
                Settings = ScriptableObject.CreateInstance <HVRStabberSettings>();
            }

            if (!FallbackSettings)
            {
                FallbackSettings = ScriptableObject.CreateInstance <HVRStabbableSettings>();
            }

            StabbedObjects    = new List <GameObject>(Settings.AllowedStabs);
            StabbedStabbables = new List <HVRStabbable>(Settings.AllowedStabs);

            foreach (var sc in StabbingColliders)
            {
                if (sc.contactOffset > ContactOffset)
                {
                    sc.contactOffset = ContactOffset;
                }
            }
        }