Exemplo n.º 1
0
        public void SwipeDetectorHandle(SwipeData data)
        {
            //text.text = "SwipeDetector_OnSwipe";
            int selectedSubScene = GetSelectedScene(data.StartPosition);

            SubScene subscene = GameManager.GetInstance().GetSubScene(selectedSubScene);

            if (subscene == null)
            {
                Debug.Log("subscene not found, check your selectedSubScene index");
                return;
            }
            SceneEventManager eventManager = subscene.GetEventManager();

            if (eventManager == null)
            {
                Debug.Log("eventManager not found in scene");
                return;
            }

            if (data.Direction.Equals(SwipeDirection.Down))
            {
                //eventManager.SwipeDownEvent();
                eventManager.CallEvent(ApplicationConstants.EVENT_IO_SWIPE_DOWN, ActionParams.EmptyParams);
            }

            if (data.Direction.Equals(SwipeDirection.Tap))
            {
                //eventManager.SwipeUpEvent();
                eventManager.CallEvent(ApplicationConstants.EVENT_IO_TAP, ActionParams.EmptyParams);
                //eventManager.SwipeUpEvent();
                //eventManager.CallEvent("onSwipeUpEvent");
            }
        }
Exemplo n.º 2
0
    private bool flag = false;//判断在黑屏结束后是否先按下space 再检测keyup 否则可能直接又开始黑屏
    // Use this for initialization
    void Start()
    {
        GameObject propmanager = GameObject.Find("SceneEventManager");

        sceneeventmanager = propmanager.GetComponent <SceneEventManager>();
        coloroffset       = new Color(0.1f, 0.1f, 0.1f, 0);
        origincolor       = GetComponent <SpriteRenderer>().color;
    }
Exemplo n.º 3
0
    private void Init()
    {
        GameObject pools = GameObject.Find("pools");

        movement          = pools.GetComponent <PoolMaskMovement>();
        manager           = pools.GetComponent <LevelManager>();
        textAppearance    = GameObject.Find("Dialogue").GetComponent <TextAppearance>();
        sceneEventManager = GameObject.Find("GameManager").GetComponent <SceneEventManager>();

        //get default values to allow for live restoration
        baseMovementSpeed       = movement.transitionSpeed;
        baseTimeWaitClientEnter = sceneEventManager.timeWaitClientEnter;
    }
Exemplo n.º 4
0
    // Start is called before the first frame update
    void Awake()
    {
        //todo fix
        _sceneIndex = Convert.ToInt32(gameObject.name.Split(' ')[1]) - 1;

        SubSceneMultiton.SetInstance(_sceneIndex, this);

        mScreenHeightInWorld = Camera.main.orthographicSize * 2.0f;
        mScreenWidthInWorld  = mScreenHeightInWorld * Camera.main.aspect;

        _sceneSpeed = 0;

        mSceneEventManager = new SceneEventManager();

        mMetersToChangeWorld = UnityEngine.Random.Range(mMinMetersToChangeWorld, mMaxMetersToChangeWorld);

        //GameObject go = new GameObject();
        //go.transform.parent = transform;
        //localPowerUpManager = go.AddComponent<LocalPowerUpManager>();
        //localPowerUpManager.SetSubScene(this);
    }
Exemplo n.º 5
0
 /// <summary>
 /// Event fire when ShopScene is fully loaded
 /// </summary>
 /// <param name="arg0"></param>
 /// <param name="arg1"></param>
 private void ShopScene_sceneLoaded(Scene arg0, LoadSceneMode arg1)
 {
     SceneManager.sceneLoaded -= ShopScene_sceneLoaded;
     _shopSceneManager         = GameObject.Find("GameManager").GetComponent <SceneEventManager>();
     _shopSceneManager.LaunchStartOfDay();
 }
    //========================================================================================
    //                                    public - override
    //========================================================================================

    /// <summary>
    /// オブジェクト作成時
    /// </summary>
    private void Awake()
    {
        myInstance = this;
    }
Exemplo n.º 7
0
        private static IEventManager <TEvent> CreateSceneEventManager <TEvent>()
        {
            var eventManager = new SceneEventManager <TEvent>();

            return(eventManager);
        }