Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EnergyBarScript : MonoBehaviour {
- public void UpdateEnergyBar ( Transform energySprite, float currentEnergy, Vector3 energyScale)
- {
- // if (energySprite == null)
- // return;
- Debug.Log ("EnergySprite" + energySprite.name);
- energySprite.transform.localScale = new Vector2 (energyScale.x + currentEnergy , 1);
- Debug.Log ("energySprite scale on x axes " + energySprite.transform.localScale.x);
- }
- public void ColorMatchFunction(string color, float DamageAmount)
- {
- ColorMatch colorMathc = ColorFactory.CreateColorFromName (color);
- colorMathc.DoColor (DamageAmount);
- string colorName = colorMathc.GetColorName ();
- Debug.Log ("Color that had an Match3 " + colorName);
- }
- }
- public interface ColorMatch
- {
- void DoColor(float DamageAmount);
- string GetColorName();
- }
- public class BlueMaterial : ColorMatch
- {
- MenuScript menuScriptObj = GameObject.Find("Menu").GetComponent<MenuScript>();
- EnergyBarScript energyBar = GameObject.Find("Items").GetComponent<EnergyBarScript>();
- public void DoColor(float DamageAmount)
- {
- Debug.Log ("This is _blue " + menuScriptObj._blue);
- menuScriptObj.blueEnergy += DamageAmount;
- menuScriptObj.blueEnergy = Mathf.Clamp (menuScriptObj.blueEnergy, 1, 101);
- energyBar.UpdateEnergyBar ( menuScriptObj.blue, menuScriptObj.blueEnergy, menuScriptObj.blueScale);
- }
- public string GetColorName()
- {
- return "This is BlueMaterial";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement