コード例 #1
0
        private static void Prefix(scnEditor __instance)
        {
            if (!Main.IsEnabled ||
                !scrController.instance.paused ||
                GCS.standaloneLevelMode)
            {
                if (_gameObject == null)
                {
                    return;
                }
                Object.DestroyImmediate(_gameObject);
                Object.DestroyImmediate(_mainBehavior);
                _gameObject   = null;
                _mainBehavior = null;

                return;
            }

            if (_gameObject != null ||
                !Input.GetKeyDown(KeyCode.F9) ||
                Input.GetKey(KeyCode.LeftAlt) ||
                Input.GetKey(KeyCode.RightAlt) ||
                Input.GetKey(KeyCode.LeftControl) ||
                Input.GetKey(KeyCode.RightControl) ||
                Input.GetKey(KeyCode.LeftCommand) ||
                Input.GetKey(KeyCode.RightCommand))
            {
                return;
            }

            _gameObject   = new GameObject();
            _mainBehavior = _gameObject.AddComponent <MainBehavior>();
        }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     mainScript      = GameObject.Find("Floor").GetComponent <MainBehavior> ();
     fireworksPrefab = (GameObject)Resources.Load("Prefabs/fireworks", typeof(GameObject));
     bc = GetComponent <BoxCollider> ();
 }