示例#1
0
 private void OnValidate()
 {
     instance = this;
     if (dirty)
     {
         CreateMultipleMeshes();
         dirty = false;
     }
 }
示例#2
0
    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;
    }
示例#4
0
    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;
    }
示例#5
0
        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);
        }
    }
示例#7
0
	// Use this for initialization
	void Start () {
		Player = GameObject.FindWithTag ("Player");
		ScriptplayerManger = Player.transform.GetComponent<playerManager>();
		PlatformCreatorObject = GameObject.FindWithTag ("PlatformCreator");
		ScriptPlatformCreator = PlatformCreatorObject.GetComponent<PlatformCreator>();
	}
示例#8
0
 void Start()
 {
     player   = FindObjectOfType <Player>();
     platform = FindObjectOfType <PlatformCreator>();
 }
 private void OnEnable()
 {
     creator = target as PlatformCreator;
 }
示例#10
0
 void Awake()
 {
     body            = GetComponent <Rigidbody> ();
     platformCreator = GetComponent <PlatformCreator> ();
     deathDepthDelta = deathDepth;
 }
示例#11
0
	// Use this for initialization
	void Start () {
		Player = GameObject.FindWithTag ("Player");
		PlatformCreatorObject = GameObject.FindWithTag ("PlatformCreator");
		PlatformCreatorScript = PlatformCreatorObject.GetComponent<PlatformCreator>();

	}
示例#12
0
 // Use this for initialization
 void Start()
 {
     theGameManager     = FindObjectOfType <GameManager> ();
     theScoreManager    = FindObjectOfType <ScoreManager> ();
     thePlatformCreator = FindObjectOfType <PlatformCreator> ();
 }
示例#13
0
    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);
    }
示例#14
0
 private void Start()
 {
     platformCreator  = platformCreatorSpace.GetComponent <PlatformCreator>();
     cameraController = mainCamera.GetComponent <CameraController>();
 }