コード例 #1
0
        } //END RemoveExistingComponent

        //----------------------------------------------//
        private void AddNewComponent()
        //----------------------------------------------//
        {
            //If we're adding a new tween via this event, create the tween and attach it to this gameObject for easy editing
            if( action == Action.CreateTween )
            {
                if( action == Action.None ) { return; }

                string newComponentName = "BrandXR.bxrTween" + tweenType.ToString();

                Type componentType = ComponentHelper.FindType( newComponentName );

                //showDebug = true;
                if( showDebug ) { Debug.Log( "BlockEventTween.cs AddNewComponent() name = " + newComponentName + ", Type = " + componentType ); }

                tween = (bxrTween)gameObject.AddComponent( componentType );
            }
            
        } //END AddNewComponent
コード例 #2
0
        //---------------------------------//
        private void _AddEvent( BlockEventBase.EventType eventType )
        //---------------------------------//
        {
            GameObject go = new GameObject( eventType.ToString() + " Event" );
            go.transform.parent = transform;

            string newComponentName = "BrandXR.BlockEvent" + eventType.ToString();
            Type componentType = ComponentHelper.FindType( newComponentName );
            
            BlockEventHelper helper = new BlockEventHelper( eventType );
            helper.SetBlockEventBase( (BlockEventBase)go.AddComponent( componentType ) );
            helper.GetBlockEventBase()._PrefabManager = _PrefabManager;

            blockEventHelpers.Add( helper );

            if( showDebug )
            {
                Debug.Log( "BlockEvent.cs _AddEvent() Added new Helper(" + helper.GetBlockEventBase().name + ")! blockEventHelpers.Count = " + blockEventHelpers.Count );
            }

        } //END AddEvent