Month: August 2017

  • Stopping the StartCoroutine with blinking function

    The solution may seem simple but it took me a while to figure it out so I thought I’d note it here using a blinking function. public IEnumerator animateTint(GameObject obj,Color newColour,float speed = 2){         Color originalColor = newColour;         Color targetColor = newColour;         Color defaultBtnColor = new Color();     ColorUtility.TryParseHtmlString (btnColor, out defaultBtnColor);     while (obj.GetComponent<Renderer> ().material.color != newColour) {         Material objMat = obj.GetComponent<Renderer> ().material;         Color curColour = objMat.color;         if(closeEnough(curColour.r,targetColor.r) && closeEnough(curColour.g,targetColor.g) && closeEnough(curColour.b,targetColor.b) ){             //objMat.color = newColour;             print (“change tint “+targetColor);             if(targetColor == newColour){                 targetColor = defaultBtnColor;             }else{                 yield return StartCoroutine(CoroutineUtil.WaitForRealSeconds(1)); //2                 targetColor = newColour;             }             //yield break;             }         buttonCode btnCode = obj.transform.parent.GetComponent<buttonCode> ();              if(btnCode.isBlinking){         objMat.color = Color.Lerp(curColour,targetColor, speed * Time.deltaTime);         }else{                 objMat.color = Color.white;             yield return null;         }         //print (“tinting “+curColour);         yield return null;…

  • Kards Week 104 Progress

    The screenshot are the different graphics for the battle animations depending on the type of battle. There are 5 types, 1 for each card species and a neutral one. I already know how they’re going to animate – it’s fairly simple but hopefully it won’t be too hard to implement. What’s next: put these in…

  • Adding sorting layers to text

    You change which sprite is in front or back of each other using sorting layers. UI Text objects do not have sorting layers though. To sort text objects so they are behind or in front of sprites, add the Canvas component to it. Tick the ‘override sorting’ checkbox and now you can add a sorting…

  • Kards Week 103 Progress

    Added an indicator for type advantage when battling as shown in the middle of the screenshot. If there are is none, then it shows their power number instead. Tested this when the type advantage was reversed and when both fighters are equally matched. Also fixed a bug where certain spells where unplayable or not supposed…

  • Kards Week 102 Progress

    Printed out the booklet. In total it’s 21 pages so to save paper I skipped the first page. It was just the intro and table of contents. What’s next: test out the booklet and the digital version.

  • Kards Week 101 Progress

    I made a proper table of contents for the rule book as shown in the screenshot. Getting the line of dots also known as tab leaders was more complicated than I would have liked. I also added page numbers. I reread the rules from start to finish and made some small adjustments. A pdf is…