Esempio n. 1
0
    protected void Awake()
    {
        buoyancy    = Resources.Load <ScriptableInt>("ScriptableObjects/buoyancy");
        weightWater = Resources.Load <ScriptableInt>("ScriptableObjects/weightWater");
        weightLoad  = Resources.Load <ScriptableInt>("ScriptableObjects/weightLoad");
        weightTotal = Resources.Load <ScriptableInt>("ScriptableObjects/weightTotal");

        numLeaksAbove = Resources.Load <ScriptableInt>("ScriptableObjects/numLeaksAbove");
        numLeaksBelow = Resources.Load <ScriptableInt>("ScriptableObjects/numLeaksBelow");
        distLeakAbove = Resources.Load <ScriptableInt>("ScriptableObjects/distLeakAbove");
        distLeakBelow = Resources.Load <ScriptableInt>("ScriptableObjects/distLeakBelow");

        spriteTossableSet = Resources.Load <SpriteTossableSet>("ScriptableObjects/SpriteSets/SpriteTossableSet");

        levelMsg = Resources.Load <StringParamEvent>("ScriptableObjects/Events/WithParam/Str_AnyMsg");

        myRigidbody = this.GetComponentIfNull(myRigidbody);

        if (myColliders == null || myColliders.Length == 0)
        {
            myColliders = GetComponentsInChildren <Collider2D>();
        }

        SubmergableAreaRef = GetComponent <RefRect2D>();
        holesSubm          = new List <Hole>();
        holesSurf          = new List <Hole>();
        Pinholes           = new List <Hole>();
    }
Esempio n. 2
0
    private void Awake()
    {
        // ! gameCtrl.Init is just here while building levels, so we don't need to go through PreGame during testing.
        // Once game is ready to ship, delete it.
        items             = Resources.Load <ItemBaseSet>("ScriptableObjects/SpriteSets/ItemBaseSet");
        enemies           = Resources.Load <EnemySet>("ScriptableObjects/SpriteSets/EnemySet");
        spriteTossableSet = Resources.Load <SpriteTossableSet>("ScriptableObjects/SpriteSets/SpriteTossableSet");

        holdWeight = Resources.Load <ScriptableInt>("ScriptableObjects/weightHeldObj");
        mousePos   = Resources.Load <ScriptableVector2>("ScriptableObjects/v2_mouseWorldPos");

        levelMsg = Resources.Load <StringParamEvent>("ScriptableObjects/Events/WithParam/Str_AnyMsg");

        WaterSurfaceYPos = (waterObj.transform.position.y + (waterObj.GetComponent <Game2DWater>().WaterSize.y * 0.5f));

        gameCtrl.Init();
    }