Coding click multiplier in C#. Help!
I'm super new to this but I really want to get this mastered because I have so many ideas. I watched tutorials for many things so far and they've helped immensely. Now I want to put a click multiplier into the game (the x1, x10, x25, x50, x100 thing to make it easier to buy n amount of upgrades instead of one at a time). I want to attach this script to a button called ClickMultiplier. The button has a child Text like all buttons do. This script's goal is to change the text on that button to say whatever multiplier it's currently on. This sounds like a simple thing considering I have code just like this in another script and the text changes everytime I harvest wheat, increasing by the correct amount as it should. So since this code is the same as the other... why it no work? O_O Help, please?
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ClickMultiplier : MonoBehaviour { %|66243141_1|% public UnityEngine.UI.Text multDisplay; void Update(){ %|1058379980_4|% } %|-1908332318_6|% if (mult == 1) { mult = 10; %|1755310708_9|% if (mult == 10) { mult = 25; %|1568572544_12|% if (mult == 25) { mult = 50; } if (mult == 50) { %|-1711106826_17|% } if (mult == 100) { mult = 1; } } }
It's giving me this error in the console:
Assets/Scripts/ClickMultiplier.cs(12,9): error CS1520: Class, struct, or interface method must have a return type
It's talking about the line "public Clicked () {" Everything else seems fine. So I'm not sure what's going on here and I've exhausted myself on Google trying in vain to find a solution.
Would help if you used the code format for the code. It s quite "hard" to debug something on this format.