private void OnValidate() { instance = this; if (dirty) { CreateMultipleMeshes(); dirty = false; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); PlatformCreator platformCreator = (PlatformCreator)target; if (GUILayout.Button("Create Mesh")) { platformCreator.createMesh(); } }
// Start is called before the first frame update void Start() { // Get these private variables assigned so that we can start to modify data for powerups. scoreManagement = FindObjectOfType <ScoreManager>(); platformGenerator = FindObjectOfType <PlatformCreator>(); gameManager = FindObjectOfType <GameManagement>(); // get references to the original values of the score multiple and the spike remover. normalPointsPerSecond = scoreManagement.scorePerSecond; spikeRate = platformGenerator.randomSpikeGeneratePercentage; maximumHeightOriginal = platformGenerator.maximumHeightChange; }
public void StartGame() { ambient.Stop(); Screen.sleepTimeout = 600; Time.timeScale = 1; menu.SetActive(false); gameplay.SetActive(true); PlayerData.score = 0; PlatformCreator.Reset(); gameMusic.Play(); ball.GetComponent <AudioSource>().volume = 0.05f; }
public void RespawnPlayer(Transform pos) { ReduceLivePoints(1); UpdateLiveImage(); if (LivePointValue <= 0) { FindObjectOfType <PlayerManager>().DeletePLayer(GetComponent <playerController>()); Destroy(gameObject); return; } PlatformCreator tr = FindObjectOfType <PlatformCreator>(); transform.position = pos.position; }
public override void OnInspectorGUI() { PlatformCreator platformCreator = (PlatformCreator)target; base.OnInspectorGUI(); filename = EditorGUILayout.TextField("Filename:", filename); EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); DrawNewType(); DrawCurrentTypes(); if (GUILayout.Button("Reset Platform Types")) { CheckFileExists(); File.WriteAllText(filename, standardTypes); } }
// Use this for initialization void Start () { Player = GameObject.FindWithTag ("Player"); ScriptplayerManger = Player.transform.GetComponent<playerManager>(); PlatformCreatorObject = GameObject.FindWithTag ("PlatformCreator"); ScriptPlatformCreator = PlatformCreatorObject.GetComponent<PlatformCreator>(); }
void Start() { player = FindObjectOfType <Player>(); platform = FindObjectOfType <PlatformCreator>(); }
private void OnEnable() { creator = target as PlatformCreator; }
void Awake() { body = GetComponent <Rigidbody> (); platformCreator = GetComponent <PlatformCreator> (); deathDepthDelta = deathDepth; }
// Use this for initialization void Start () { Player = GameObject.FindWithTag ("Player"); PlatformCreatorObject = GameObject.FindWithTag ("PlatformCreator"); PlatformCreatorScript = PlatformCreatorObject.GetComponent<PlatformCreator>(); }
// Use this for initialization void Start() { theGameManager = FindObjectOfType <GameManager> (); theScoreManager = FindObjectOfType <ScoreManager> (); thePlatformCreator = FindObjectOfType <PlatformCreator> (); }
public override bool Process(string[] args) { if (platform == null) { platform = FindObjectOfType <PlatformCreator>(); player = FindObjectOfType <Player>(); } if (args.Length > 1 || args.Length < 1) { return(false); } Vector3 playerPos = player.transform.position; Vector3 angle = Vector3.zero; if ("right".Equals(args[0], System.StringComparison.OrdinalIgnoreCase)) { Vector3 newPos = playerPos + (player.transform.right * platform.distanceBeetwenBlocks); if (platform.IsInPlatform(newPos)) { player.CallLerpPose(newPos, new Vector3(0, 90, 0)); return(true); } else { return(false); } } else if ("left".Equals(args[0], System.StringComparison.OrdinalIgnoreCase)) { Vector3 newPos = playerPos + (-player.transform.right * platform.distanceBeetwenBlocks); if (platform.IsInPlatform(newPos)) { player.CallLerpPose(newPos, new Vector3(0, -90, 0)); return(true); } else { return(false); } } else if ("forward".Equals(args[0], System.StringComparison.OrdinalIgnoreCase)) { Vector3 newPos = playerPos + (player.transform.forward * platform.distanceBeetwenBlocks); if (platform.IsInPlatform(newPos)) { player.CallLerpPose(newPos, new Vector3(0, 0, 0)); return(true); } else { return(false); } } else if ("back".Equals(args[0], System.StringComparison.OrdinalIgnoreCase)) { Vector3 newPos = playerPos + (-player.transform.forward * platform.distanceBeetwenBlocks); if (platform.IsInPlatform(newPos)) { player.CallLerpPose(newPos, new Vector3(0, 180, 0)); return(true); } else { return(false); } } return(false); }
private void Start() { platformCreator = platformCreatorSpace.GetComponent <PlatformCreator>(); cameraController = mainCamera.GetComponent <CameraController>(); }