update level1
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.LightTransport;
|
||||
|
||||
public class WorldSwitcher : MonoBehaviour
|
||||
{
|
||||
private const float _SCALE_DURATION = 0.5f;
|
||||
private const float _SCALE_FACTOR = 100.0f;
|
||||
private const float _SCALE_FACTOR = 150.0f;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _spriteMask;
|
||||
@@ -42,6 +43,10 @@ public class WorldSwitcher : MonoBehaviour
|
||||
var currentScale = _spriteMask.transform.localScale;
|
||||
var from = _currentWorldIndex == 0 ? currentScale : new Vector3(_SCALE_FACTOR, _SCALE_FACTOR, 1);
|
||||
var to = newIndex == 0 ? Vector3.zero : new Vector3(_SCALE_FACTOR, _SCALE_FACTOR, 1);
|
||||
|
||||
_world2.SetActive(true);
|
||||
_world1.SetActive(true);
|
||||
|
||||
StartCoroutine(ScaleOverTime(_spriteMask.transform, from, to, _SCALE_DURATION, () =>
|
||||
{
|
||||
_currentWorldIndex = newIndex;
|
||||
|
||||
Reference in New Issue
Block a user