private void OnEnable()
    {
        stamp           = new GameObject("Stamp");
        stamp.hideFlags = HideFlags.HideAndDontSave;
        bc = target as BlocCreator;
        if (bc.SelectedPrefab != null)
        {
            CreateNewStamp();
        }

        var scriptObject = bc.gameObject;

        editorPS       = PhysicsSceneExtensions2D.GetPhysicsScene2D(scriptObject.scene);
        scriptableProp = serializedObject.FindProperty("blocsScriptable");
        if (bc.currentBlocSelection != null)
        {
            blocYRange             = bc.currentBlocSelection.blocYRange;
            gOffset                = bc.currentBlocSelection.globalOffsetRange;
            rotOff                 = bc.currentBlocSelection.globalRotationOffsetRange;
            selectedBlocDifficulty = (int)bc.currentBlocSelection.blocDifficulty;
            blocArea               = bc.currentBlocSelection.blockArea;
        }

        GetSavedBlocsNames();
        RefreshBlocNameAndDiff();

        EditorUtility.SetDirty(bc.blocsScriptable);
    }
示例#2
0
        // LIFE-CYCLE

        private void Awake()
        {
            inputCastMask = LayerMask.GetMask("Input");
            entityManager = World.Active.EntityManager;
            physicsScene  = PhysicsSceneExtensions2D.GetPhysicsScene2D(SceneManager.GetActiveScene());
            camera        = Camera.main;

            CreatePlaceholder();
        }