Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        locationService            = Input.location;
        locationCoordination       = ScriptableObject.CreateInstance <LocationCoordination>();
        distanceCalculator         = gameObject.GetComponent <DistanceCalculator>();
        googleMapDrawer            = GameObject.FindGameObjectWithTag("MapDrawer").GetComponent <GoogleMapDrawer>();
        spotManager                = GameObject.FindGameObjectWithTag("SpotManager").GetComponent <SpotManager>();
        googleMapDrawer.Calculator = locationCoordination;
        //ロケーションサービスが無効、かつユーザーが許可しているなら
        //ロケーションサービスを有効化
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
        case RuntimePlatform.IPhonePlayer:
            isMobilePlatform = true;
            break;
        }
        if (isMobilePlatform)
        {
            switch (locationService.status)
            {
            case LocationServiceStatus.Stopped:
                LocationUpdate();
                break;

            default:
                break;
            }
        }
        else
        {
            locationCoordination.SetCoordination(initlong, initlat);
        }
    }
Esempio n. 2
0
    public void ArrangeOnMap(float moveDuration = 0.5f)
    {
        Vector2 pos = SpotManager.GetSpotPos(id);

        pos.y  = -pos.y;
        pos.y -= YearBook.dimPhoto.y * 0.5f;
        card.MoveTo(pos, YearBook.dimPhoto, moveDuration);
    }
Esempio n. 3
0
    public static SpotManager Get()
    {
        if (_thisInstance == null)
        {
            GameObject newGameObject = new GameObject("SpotManager");
            _thisInstance = newGameObject.AddComponent <SpotManager>();
        }

        return(_thisInstance);
    }
Esempio n. 4
0
 void Awake()
 {
     if (_thisInstance == null)
     {
         _thisInstance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 5
0
    IEnumerator Dig(string type, float duration)
    {
        //BEGINNING--------------------------------------------------------
        PlayerController.controlsAble = false;
        anim.SetTrigger("DigTrigger");
        ParticleSystem instDigFX = Instantiate(digFX, transform.position, Quaternion.identity);          //Instantiate FX

        Destroy(instDigFX, duration);
        Coroutine soundCo = StartCoroutine(DiggingSound(duration));

        switch (type)
        {
        case "Spot":
            Debug.Log("You digged out the " + newSpotManager.type + " number " + newSpotManager.part);
            Camera.main.GetComponent <InventoryManager> ().playerInventory.AddItem(newSpotManager.type, newSpotManager.part);
            break;
        }

        //DURING
        yield return(new WaitForSeconds(duration));

        //AFTER---------------------------------------------------------------

        switch (type)
        {
        case "Spot":
            //PartPreview (newSpotManager.type, newSpotManager.part); //Instantiate canvas with preview of the sk part
            PartPreviewOverlay();
            Destroy(newSpotManager.transform.gameObject);
            newSpotManager = null;
            break;

        case "Baril":
            newRbBaril.freezeRotation = false;
            newRbBaril.isKinematic    = false;
            newRbBaril.AddForce(new Vector3(0, 50, 0));
            break;

        case "Palmier":
            newPalmier.NoixDeCocoFall();
            newPalmier = null;
            break;
        }

        anim.SetTrigger("DigOverTrigger");
        if (type != "Spot")
        {
            PlayerController.controlsAble = true;
        }
    }
Esempio n. 6
0
    }    //Check l'Input

    void OnTriggerStay(Collider other)
    {
        float distance = Vector3.Distance(other.transform.position, transform.position);

        //SPOT------------------------------------------------------------------------------------------------
        if (other.tag == "Spot" && digInput && distance < 3f)
        {
            newSpotManager = other.transform.GetComponent <SpotManager> ();
            StartCoroutine(Dig("Spot", 1.5f));
            digInput = false;
        }
        //RUBBLE----------------------------------------------------------------------------------------------
        else if (other.tag == "Rubble" && digInput && distance < 6f)
        {
            RubbleManager rubMan = other.gameObject.GetComponent <RubbleManager> ();
            if (rubMan.readyToDig)
            {
                rubMan.StartCoroutine("RubbleClear");
                PlayerController.controlsAble = false;
                anim.SetTrigger("DigTrigger");
            }
            digInput = false;
        }
        //BARIL------------------------------------------------------------------------------------------
        else if (other.tag == "Baril" && digInput && distance < 3.5f && other.GetComponent <Rigidbody>().isKinematic)
        {
            newRbBaril = other.GetComponent <Rigidbody>();
            StartCoroutine(Dig("Baril", 1f));
            digInput = false;
        }
        else if (other.tag == "Palmier" && digInput && distance < 3f)
        {
            print("nice");
            StartCoroutine(Dig("Palmier", 1f));
            digInput   = false;
            newPalmier = other.GetComponent <PalmiersScripts> ();
        }
    }
Esempio n. 7
0
        /// <summary>
        /// Singleton 응용 프로그램 개체를 초기화합니다.  이것은 실행되는 작성 코드의 첫 번째
        /// 줄이며 따라서 main() 또는 WinMain()과 논리적으로 동일합니다.
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;



            /*** Injecting objects to public static instances ***/

            // App
            MobileService = new MobileServiceClient(
                "https://pinthecloud.azure-mobile.net/",
                "yvulzHAGRgNsGnPLHKcEFCPJcuyzKj23"
                );
            ApplicationSessions = new WSApplicationSessions();
            ApplicationSettings = new WSApplicationSettings();

            // Manager
            SpotManager         = new SpotManager();
            Geolocator          = new Geolocator();
            BlobStorageManager  = new BlobStorageManager();
            LocalStorageManager = new LocalStorageManager();

            OneDriveManager   = new OneDriveManager();
            DropBoxManager    = new DropboxManager();
            GoogleDriveManger = new GoogleDriveManager();


            /////////////////////////////////////////////////////
            // This order will be displayed at every App Pages
            /////////////////////////////////////////////////////
            StorageHelper.AddStorageManager(OneDriveManager.GetStorageName(), OneDriveManager);
            StorageHelper.AddStorageManager(DropBoxManager.GetStorageName(), DropBoxManager);
            StorageHelper.AddStorageManager(GoogleDriveManger.GetStorageName(), GoogleDriveManger);
            Switcher.SetStorageToMainPlatform();
            AccountManager = new AccountManager();
        }
Esempio n. 8
0
    private IEnumerator DoInitialize()
    {
        eventData = (SectionEventData)GameSection.GetEventData();
        if (MonoBehaviourSingleton <InGameManager> .IsValid())
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData(MonoBehaviourSingleton <InGameManager> .I.beforePortalID);
        }
        if (MonoBehaviourSingleton <OutGameSettingsManager> .IsValid() && portalData == null)
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData((uint)MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.linkFieldPortalID);
        }
        if (eventData.IsQuestToField())
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData(MonoBehaviourSingleton <FieldManager> .I.currentPortalID);
        }
        if (portalData == null)
        {
            base.Initialize();
        }
        else
        {
            FieldMapTable.FieldMapTableData currentMapData = Singleton <FieldMapTable> .I.GetFieldMapData(portalData.srcMapID);

            newMapData = Singleton <FieldMapTable> .I.GetFieldMapData(portalData.dstMapID);

            regionId = newMapData.regionId;
            if (NeedDirectionOpenRegion())
            {
                toRegionRelease = true;
                base.Initialize();
            }
            else
            {
                if (currentMapData != null && newMapData != null && newMapData.regionId != currentMapData.regionId)
                {
                    regionId = currentMapData.regionId;
                }
                if (newMapData == null || !IsValidRegion(newMapData))
                {
                    newMapData = null;
                    base.Initialize();
                }
                else
                {
                    LoadingQueue loadQueue          = new LoadingQueue(this);
                    LoadObject   loadedEventUIRoot  = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "NewFieldOpenEventUIRoot", false);
                    LoadObject   loadedLocationSpot = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "LocationSpot", false);
                    LoadObject   loadedEventCamera  = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "NewFieldEventCamera", false);
                    LoadObject   loadedFilterCamera = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "ZoomBlurFilterCamera", false);
                    LoadObject   loadedPlayerMarker = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "PlayerMarker", false);
                    LoadObject   loadedRegion       = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "RegionMap_" + regionId.ToString("D3"), false);
                    LoadObject   loadedEffect       = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_UI, "ef_ui_map_fire_01", false);
                    LoadObject   loadedWindEffect   = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_bg_questmap_01", false);
                    LoadObject   loadedDungeonEff   = null;
                    if (eventData.IsFindNewDungeon() && newMapData != null)
                    {
                        uint mapID = newMapData.mapID;
                        loadedDungeonEff = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_DUNGEON, "DEF_" + mapID.ToString("D8"), false);
                    }
                    LoadObject loadedEncounterBossCutIn = null;
                    if (eventData.IsEncounterBossEvent())
                    {
                        loadedEncounterBossCutIn = loadQueue.Load(RESOURCE_CATEGORY.UI, "InGameFieldQuestWarning", false);
                    }
                    CacheAudio(loadQueue);
                    if (loadQueue.IsLoading())
                    {
                        yield return((object)loadQueue.Wait());
                    }
                    if (loadedEncounterBossCutIn != null)
                    {
                        fieldQuestWarningRoot = ResourceUtility.Realizes(loadedEncounterBossCutIn.loadedObject, -1).get_gameObject();
                        UIPanel panel = fieldQuestWarningRoot.GetComponentInChildren <UIPanel>();
                        if (panel != null)
                        {
                            panel.depth = 8000;
                        }
                        if (MonoBehaviourSingleton <UIInGameFieldQuestWarning> .IsValid())
                        {
                            MonoBehaviourSingleton <UIInGameFieldQuestWarning> .I.Load(loadQueue);
                        }
                    }
                    if (loadQueue.IsLoading())
                    {
                        yield return((object)loadQueue.Wait());
                    }
                    topEffectPrefab = loadedEffect.loadedObject;
                    Transform t = ResourceUtility.Realizes(loadedEventUIRoot.loadedObject, base._transform, -1);
                    regionMapRoot = ResourceUtility.Realizes(loadedRegion.loadedObject, MonoBehaviourSingleton <AppMain> .I._transform, -1).get_gameObject().GetComponent <RegionMapRoot>();
                    if (regionMapRoot != null)
                    {
                        bool wait = true;
                        regionMapRoot.InitPortalStatus(delegate
                        {
                            ((_003CDoInitialize_003Ec__Iterator164) /*Error near IL_0526: stateMachine*/)._003Cwait_003E__15 = false;
                        });
                        while (wait)
                        {
                            yield return((object)null);
                        }
                    }
                    blurFilter = (ResourceUtility.Instantiate <Object>(loadedFilterCamera.loadedObject) as GameObject).GetComponent <ZoomBlurFilter>();
                    blurFilter.get_transform().set_parent(base._transform);
                    _camera          = ResourceUtility.Realizes(loadedEventCamera.loadedObject, MonoBehaviourSingleton <AppMain> .I._transform, -1).GetComponent <Camera>();
                    uiFrontMapSprite = t.FindChild("FrontMap").get_gameObject().GetComponent <UITexture>();
                    if (uiFrontMapSprite != null)
                    {
                        uiFrontMapSprite.alpha = 0f;
                    }
                    uiMapSprite = t.FindChild("Map").get_gameObject().GetComponent <UITexture>();
                    InitMapSprite(MonoBehaviourSingleton <ScreenOrientationManager> .I.isPortrait);
                    if (eventData.IsEncounterBossEvent())
                    {
                        t.FindChild("TaptoSkip").get_gameObject().SetActive(false);
                    }
                    bgEventListener = UIEventListener.Get(t.Find("BG").get_gameObject());
                    tutorialTrigger = t.FindChild("TUTORIAL_TRIGGER");
                    if (tutorialTrigger != null)
                    {
                        if (!TutorialStep.HasAllTutorialCompleted())
                        {
                            tutorialTrigger.get_gameObject().SetActive(true);
                            UITweenCtrl.Play(tutorialTrigger, true, null, false, 0);
                        }
                        else
                        {
                            tutorialTrigger.get_gameObject().SetActive(false);
                        }
                    }
                    spots = new SpotManager(null, loadedLocationSpot.loadedObject as GameObject, _camera);
                    spots.spotRootTransform = t;
                    playerMarker            = ResourceUtility.Realizes(loadedPlayerMarker.loadedObject, -1);
                    PlayerMarker playerMarkerCom = playerMarker.GetComponent <PlayerMarker>();
                    if (null != playerMarkerCom)
                    {
                        playerMarkerCom.SetCamera(_camera.get_transform());
                    }
                    windEffect         = ResourceUtility.Realizes(loadedWindEffect.loadedObject, _camera.get_transform(), -1).get_gameObject().GetComponent <rymFX>();
                    windEffect.Cameras = (Camera[])new Camera[1]
                    {
                        _camera
                    };
                    windEffect.get_gameObject().set_layer(LayerMask.NameToLayer("WorldMap"));
                    if (loadedDungeonEff != null)
                    {
                        dungeonOpenEffect = ResourceUtility.Realizes(loadedDungeonEff.loadedObject, base._transform, -1);
                        dungeonOpenEffect.get_gameObject().SetActive(false);
                    }
                    CreateVisitedLocationSpot();
                    if (MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName() == "InGameScene")
                    {
                        MonoBehaviourSingleton <ScreenOrientationManager> .I.OnScreenRotate += InitMapSprite;
                    }
                    base.Initialize();
                }
            }
        }
    }
Esempio n. 9
0
    private IEnumerator DoInitialize()
    {
        eventData = (SectionEventData)GameSection.GetEventData();
        FieldMapTable.PortalTableData portal = Singleton <FieldMapTable> .I.GetPortalData(MonoBehaviourSingleton <FieldManager> .I.currentPortalID);

        FieldMapTable.FieldMapTableData mapA = Singleton <FieldMapTable> .I.GetFieldMapData(portal.srcMapID);

        FieldMapTable.FieldMapTableData mapB = Singleton <FieldMapTable> .I.GetFieldMapData(portal.dstMapID);

        fromRegionID = mapA.regionId;
        toRegionID   = mapB.regionId;
        LoadingQueue loadQueue            = new LoadingQueue(this);
        LoadObject   loadedWorldMap       = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "WorldMap", false);
        LoadObject   loadedRegionSpotRoot = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "RegionSpotRoot", false);
        LoadObject   loadedRegionSpot     = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "RegionSpot", false);
        LoadObject   loadedPlayerMarker   = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "PlayerMarker", false);
        LoadObject   loadedMapGlowEffectA = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "MapGlowEffectA", false);
        LoadObject   loadedMapGlowEffectB = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "MapGlowEffectB", false);
        LoadObject   loadedTelop          = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "TelopOpenRegion", false);

        loadQueue.CacheSE(SE_ID_LOGO, null);
        loadQueue.CacheSE(SE_ID_SMOKE, null);
        uint[] openedRegionids = MonoBehaviourSingleton <WorldMapManager> .I.GetOpenRegionIdListInWorldMap();

        if (openedRegionids.Length == 0)
        {
            openedRegionids = new uint[1];
        }
        LoadObject[] regionAreaLOs    = new LoadObject[openedRegionids.Length];
        string       newRegionIcon    = ResourceName.GetRegionIcon(0);
        string       passedRegionIcon = ResourceName.GetRegionIcon(1);
        int          lastIndex        = openedRegionids.Length - 1;

        openedRegionInfo = new OpendRegionInfo[openedRegionids.Length];
        for (int j = 0; j < openedRegionids.Length; j++)
        {
            RegionTable.Data data = Singleton <RegionTable> .I.GetData(openedRegionids[j]);

            if (!data.hasParentRegion())
            {
                string iconName = passedRegionIcon;
                if (lastIndex == j)
                {
                    iconName = newRegionIcon;
                }
                LoadObject loadedObj = loadQueue.Load(RESOURCE_CATEGORY.REGION_ICON, iconName, false);
                openedRegionInfo[j] = new OpendRegionInfo(data, loadedObj);
                if (j != 0)
                {
                    regionAreaLOs[j] = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "WorldMapPart" + openedRegionids[j].ToString("D3"), false);
                }
            }
        }
        LoadObject loadedMaterial = null;

        if (!eventData.IsOnlyCameraMoveEvent())
        {
            loadedMaterial = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "WorldMapPartGlow" + toRegionID.ToString("D3"), false);
        }
        if (loadQueue.IsLoading())
        {
            yield return((object)loadQueue.Wait());
        }
        worldMapUIRoot = ResourceUtility.Realizes(loadedWorldMap.loadedObject, MonoBehaviourSingleton <AppMain> .I._transform, -1).get_gameObject();
        worldMapCamera = worldMapUIRoot.get_transform().Find("Camera").GetComponent <WorldMapCameraController>();
        worldMapCamera.isInteractive = false;
        worldMapObject = worldMapUIRoot.get_transform().FindChild("Map");
        spots          = new SpotManager(loadedRegionSpotRoot.loadedObject as GameObject, loadedRegionSpot.loadedObject as GameObject, worldMapCamera._camera);
        spots.CreateSpotRoot();
        GameObject bg = spots.spotRootTransform.Find("BG").get_gameObject();

        bg.get_gameObject().SetActive(true);
        bgEventListener = UIEventListener.Get(bg);
        spots.spotRootTransform.Find("TaptoSkip").get_gameObject().SetActive(true);
        mapGlowEffectA = ResourceUtility.Realizes(loadedMapGlowEffectA.loadedObject, worldMapObject, -1);
        mapGlowEffectA.get_gameObject().SetActive(false);
        mapGlowEffectParticleA = mapGlowEffectA.GetComponent <ParticleSystem>();
        mapGlowEffectB         = ResourceUtility.Realizes(loadedMapGlowEffectB.loadedObject, worldMapObject, -1);
        mapGlowEffectB.get_gameObject().SetActive(false);
        mapGlowEffectParticleB = mapGlowEffectB.GetComponent <ParticleSystem>();
        playerMarker           = ResourceUtility.Realizes(loadedPlayerMarker.loadedObject, base._transform, -1);
        playerMarker.get_gameObject().SetActive(false);
        if (loadedMaterial != null)
        {
            glowMaterial = (loadedMaterial.loadedObject as Material);
        }
        regionAreas = (Transform[])new Transform[regionAreaLOs.Length];
        for (int i = 0; i < regionAreaLOs.Length; i++)
        {
            LoadObject areaLO = regionAreaLOs[i];
            if (areaLO != null && null != areaLO.loadedObject)
            {
                Transform regionArea = ResourceUtility.Realizes(areaLO.loadedObject, worldMapObject, -1);
                if (i == toRegionID)
                {
                    if (eventData.IsOnlyCameraMoveEvent())
                    {
                        regionArea.get_gameObject().SetActive(true);
                    }
                    else
                    {
                        regionArea.get_gameObject().SetActive(false);
                    }
                    mapGlowEffectA.SetParent(regionArea);
                    mapGlowEffectA.set_localPosition(new Vector3(0f, 0f, 0f));
                    mapGlowEffectB.SetParent(regionArea);
                    mapGlowEffectB.set_localPosition(new Vector3(0f, 0f, 0f));
                    ShapeModule module     = mapGlowEffectParticleB.get_shape();
                    MeshFilter  meshFilter = regionArea.GetComponent <MeshFilter>();
                    module.set_mesh(meshFilter.get_sharedMesh());
                    glowRegionTop = ResourceUtility.Realizes(areaLO.loadedObject, worldMapObject, -1);
                    glowRegionTop.get_gameObject().SetActive(false);
                    glowRegionTop.set_localPosition(glowRegionTop.get_localPosition() + new Vector3(0f, 0f, 0.001f));
                    glowRegionTop.set_localScale(new Vector3(1.1f, 1.1f, 1.1f));
                    glowRegionTop.GetComponent <Renderer>().set_material(glowMaterial);
                }
                else
                {
                    regionArea.get_gameObject().SetActive(true);
                }
                regionAreas[i] = regionArea;
            }
        }
        telop = ResourceUtility.Realizes(loadedTelop.loadedObject, spots.spotRootTransform, -1);
        Transform closeBtn = Utility.Find(spots.spotRootTransform, "CLOSE_BTN");

        if (null != closeBtn)
        {
            closeBtn.get_gameObject().SetActive(false);
        }
        if (MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName() == "InGameScene")
        {
            MonoBehaviourSingleton <ScreenOrientationManager> .I.OnScreenRotate += InitMapSprite;
        }
        base.Initialize();
    }