// --- replace empty landmass with filled one private void replaceEmptyLandmassWithFileldOne(ArrayList args) { Vector3 finalPos = (Vector3)args[0]; float time = 0.0F; PG_LandmassController landmassStatController = emptyLandMass.GetComponent <PG_LandmassController>(); landmassStatController.SetFilled(); //Debug.Log("is first shape? : "+isFirstShape); if (isFirstShape) { PG_OllyAnimations.changeTexture = true; ollyAnimationsSR.ollyState = ollyAnimationStates.olly_jumpLandToWater; ollyAnimationsSR.isLastShape = isLastShape; //if(answerShapesCount>=2) //finalPos.y-=75.5F; me finalPos.y -= 75F; time = 1.3F; } else { PG_OllyAnimations.changeTexture = true; ollyAnimationsSR.ollyState = ollyAnimationStates.olly_jumpWaterToWater; ollyAnimationsSR.isLastShape = isLastShape; //finalPos.y-=75.5F; me finalPos.y -= 75F; time = 1.37F; } gameObject.transform.renderer.enabled = false; iTween.MoveTo(ollyParent, iTween.Hash("position", finalPos, "time", time, "delay", 0.17)); iTween.ScaleTo(ollyParent, iTween.Hash("time", time + 0.15f - 20.0f / 30.0f, "oncomplete", "showRippleEffect", "oncompletetarget", gameObject)); }
//-------- public IEnumerator replaceEmptyLandmassWithFilled(GameObject objectTo, float time) { yield return(new WaitForSeconds(time)); PG_LandmassController landmassStatController = objectTo.GetComponent <PG_LandmassController>(); landmassStatController.SetFilled(); }
public ArrayList ReplaceEmptyLandMassesWithFilledOne(int answerSpriteCount) //getAnswersListCount { // Debug.Log("answerSpriteCount: "+answerSpriteCount); GameObject shapeObject = null; ArrayList responseList = new ArrayList(); PG_LandmassController landmassStatController = null; int index = -1; for (int i = 0; i < answerSpriteCount; i++) { shapeObject = landMassesPlacedBWIslands[i]; if (shapeObject != null) { landmassStatController = shapeObject.GetComponent <PG_LandmassController>(); index++; } //else // Debug.Log("some thing wrong"); if (landmassStatController != null && (bool)landmassStatController.getLandmassStatus() == false) { responseList.Add(shapeObject); break; } } if (index == answerSpriteCount - 1) { responseList.Add(true); } else { responseList.Add(false); } return(responseList); }