Skip to content
Snippets Groups Projects
Commit bcefa65e authored by Meike Wienholt's avatar Meike Wienholt
Browse files

Fixed cam in mini game

parent 76cda384
No related branches found
No related tags found
1 merge request!16Meike develope
Greta/Assets/PAC Engine/Graphics/lupe.png

4.52 KiB

fileFormatVersion: 2
guid: 74fe435d1a000014da1fdbd1bdad4544
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 50edcbe3301610541ad066cfb2a49ba1
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -12596,13 +12596,17 @@ MonoBehaviour:
cursors:
- cursorId: 0
cursorTexture: {fileID: 2800000, guid: dc2acf7c56f10a644b51399b07cdbdea, type: 3}
- cursorId: 3
cursorTexture: {fileID: 2800000, guid: 74fe435d1a000014da1fdbd1bdad4544, type: 3}
- cursorId: 1
cursorTexture: {fileID: 2800000, guid: a8ade98d31aedc140b284ad8da152c92, type: 3}
normalCursorId: 0
highlightCursorId: 1
searchCursorId: 3
usingCursorId: 0
showNormalCursor: 1
showHighlightCursor: 0
showSearchCursor: 0
showUsingCursor: 0
cursorMode: 1
offset: {x: 0, y: 0}
......
This diff is collapsed.
......@@ -54,7 +54,7 @@ public class ClickManager : MonoBehaviour {
else if (h)
{
print(h);
//clicking the ground (causing the player to move)
switch (h.collider.gameObject.tag)
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
//This script is responsible for changing cursors
public class CursorChanger : MonoBehaviour {
//reference
public static CursorChanger core;
//reference
public static CursorChanger core;
//a List of all cursors
public List<cursorState> cursors = new List<cursorState>();
//a List of all cursors
public List<cursorState> cursors = new List<cursorState>();
//active cursor ID
private int activeCursor = -1;
private int initialActiveCursor;
//active cursor ID
private int activeCursor = -1;
private int initialActiveCursor;
public int normalCursorId;
public int highlightCursorId;
public int normalCursorId;
public int highlightCursorId;
public int searchCursorId;
public int usingCursorId;
[HideInInspector]
public bool showNormalCursor;
[HideInInspector]
public bool showNormalCursor;
[HideInInspector]
public bool showHighlightCursor;
[HideInInspector]
public bool showHighlightCursor;
[HideInInspector]
public bool showSearchCursor;
[HideInInspector]
public bool showUsingCursor;
......@@ -34,17 +39,34 @@ public class CursorChanger : MonoBehaviour {
//Has the cursor changed?
void Update() {
//which cursor should be used ?
if (showNormalCursor) {
if (showNormalCursor)
{
activeCursor = normalCursorId;
} else if (showHighlightCursor) {
if (SceneManager.GetActiveScene().name.Equals("Wimmelbild"))
{
searchCursorId = 0;
normalCursorId = 3;
activeCursor = searchCursorId;
}
}
else if (showHighlightCursor)
{
activeCursor = highlightCursorId;
} else if (showUsingCursor) {
}
else if (showUsingCursor)
{
activeCursor = usingCursorId;
} else {
activeCursor = -1;
}
}
else if (showSearchCursor)
{
activeCursor = searchCursorId;
}
else
{
activeCursor = -1;
}
if (initialActiveCursor != activeCursor && activeCursor != -1) {
initialActiveCursor = activeCursor;
......@@ -58,6 +80,9 @@ public class CursorChanger : MonoBehaviour {
Cursor.SetCursor(null, Vector2.zero, cursorMode);
}
Debug.Log(cursors.ToString());
}
public void switchCursor (int showCursorNo) {
......@@ -65,14 +90,24 @@ public class CursorChanger : MonoBehaviour {
showNormalCursor = true;
showHighlightCursor = false;
showUsingCursor = false;
showSearchCursor = false;
} else if (showCursorNo == 1) {
showNormalCursor = false;
showHighlightCursor = true;
showUsingCursor = false;
} else if (showCursorNo == 2) {
showSearchCursor = false;
} else if (showCursorNo == 2) {
showNormalCursor = false;
showHighlightCursor = false;
showUsingCursor = true;
showSearchCursor = false;
} else if (showCursorNo == 3)
{
showNormalCursor = false;
showHighlightCursor = false;
showUsingCursor = false;
showSearchCursor = false;
}
else
{
......@@ -97,6 +132,7 @@ public class CursorChanger : MonoBehaviour {
int findCursorIndexById (int id) {
var counter = 0;
foreach (cursorState cursor in cursors) {
Debug.Log(cursor.cursorId);
if (cursor.cursorId == id) {
return counter;
} else {
......
......@@ -36,7 +36,7 @@ public class LevelLoader : MonoBehaviour {
//this function is to be called when loading a level
//Note: level id is the id of the level in the database, not the build settings index
public void load (int levelId, bool loadingSave, PlayerData data) {
print("Im trying to load a new level");
//print("Im trying to load a new level");
//let's find build settings index
var index = SupportFunctions.core.findBuildSettingsIndexById(levelId);
//lets find location name
......
......@@ -34,6 +34,11 @@ public class TestCamera : MonoBehaviour
{
var entity = Database.core.entities[SupportFunctions.core.findEntityIndexById(115)];
//Scene scene = S
for(int i = 0; i < 12; i++)
{
Debug.Log(SupportFunctions.core.findLocationNameById(i) + i );
}
if (LevelLoader.core.loaded_Scenes.Contains(6))
{
minX = SchaffnerMinX;
......@@ -41,14 +46,15 @@ public class TestCamera : MonoBehaviour
z = -8;
print("I changed");
print(cam.transform.position);
//print(cam.transform.position);
}
if (LevelLoader.core.loaded_Scenes.Contains(11))
if (SceneManager.GetActiveScene().name.Equals(SupportFunctions.core.findLocationNameById(11)))
{
minX = MiniGameMinX;
maxX = MiniGameMaxX;
cam.transform.position = new Vector3(0.5f, 0f, -10);
minX = -0.4f;
maxX = -0.4f;
z = -5;
print("FUCK ME IN MA LONG DONG");
Debug.Log("FUCK ME IN MA LONG DONG");
}
if (player.transform.position.x < maxX && player.transform.position.x > minX)
{
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class ChangeCamera : MonoBehaviour
public class SwitchCursor : MonoBehaviour
{
public static ChangeCamera core;
public bool changeCam;
public float camPosX;
public float camPosY;
//private GameObject cam = GameObject.Find("GameManager");
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
var cam = GameObject.Find("Main Camera");
var newCam = GameObject.Find("Camera");
if (changeCam)
{
cam.SetActive(false);
newCam.SetActive(true);
}
//CursorChanger.core.switchCursor(3);
}
}
fileFormatVersion: 2
guid: 0687ffe3fca613140a49ce4b135879bd
guid: edb5ef6a28a445e4f91849e9a029ebda
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
......@@ -50,7 +50,7 @@ TagManager:
m_SortingLayers:
- name: Default
uniqueID: 0
locked: 0
locked: 1
- name: UI
uniqueID: 3199885069
locked: 0
locked: 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment