// Use this for initialization void Start() { animtor = GetComponent <Animator>(); if (Random.Range(0.0f, 1.0f) <= goodRate) { m_currMole = MoleType.Normal; animtor.Play("NormalIN"); } else if (Random.Range(0.0f, 1.0f) <= freezeRate) { m_currMole = MoleType.Frozen; animtor.Play("IceIN"); } else { m_currMole = MoleType.Evil; animtor.Play("BadIN"); } m_hitOnce = false; m_currState = MoleState.Enter; }
public void startHole() { MoleAnimator = GetComponent <Animator> (); Debug.Log("HoleStart"); MoleAnimator.Play("HoleStart"); //random Tag SnailLeveling lvl = Game1_Leveling.GetLvling(); float randomTag = Random.Range(0.0f, lvl.RightMoleRate + lvl.WrongMoleRate + lvl.DangerMoleRate); if (randomTag < lvl.RightMoleRate) { type = MoleType.MOLE_RIGHT; MoleTag.SetTagIdx(type); } else if (randomTag > lvl.RightMoleRate + lvl.WrongMoleRate) { //IsDangerMole type = MoleType.MOLE_DANGER; MoleTag.SetTagIdx(type); } else { //wrong mole type = MoleType.MOLE_WRONG; MoleTag.SetTagIdx(type); } StartCoroutine("PopMole"); }
public void SetFromStoreData(StoreData storeData) { Nickname = storeData.CoreData.Nickname; CreateId = storeData.CreateId; FontRegion = storeData.CoreData.FontRegion; FavoriteColor = storeData.CoreData.FavoriteColor; Gender = storeData.CoreData.Gender; Height = storeData.CoreData.Height; Build = storeData.CoreData.Build; Type = storeData.CoreData.Type; RegionMove = storeData.CoreData.RegionMove; FacelineType = storeData.CoreData.FacelineType; FacelineColor = storeData.CoreData.FacelineColor; FacelineWrinkle = storeData.CoreData.FacelineWrinkle; FacelineMake = storeData.CoreData.FacelineMake; HairType = storeData.CoreData.HairType; HairColor = storeData.CoreData.HairColor; HairFlip = storeData.CoreData.HairFlip; EyeType = storeData.CoreData.EyeType; EyeColor = storeData.CoreData.EyeColor; EyeScale = storeData.CoreData.EyeScale; EyeAspect = storeData.CoreData.EyeAspect; EyeRotate = storeData.CoreData.EyeRotate; EyeX = storeData.CoreData.EyeX; EyeY = storeData.CoreData.EyeY; EyebrowType = storeData.CoreData.EyebrowType; EyebrowColor = storeData.CoreData.EyebrowColor; EyebrowScale = storeData.CoreData.EyebrowScale; EyebrowAspect = storeData.CoreData.EyebrowAspect; EyebrowRotate = storeData.CoreData.EyebrowRotate; EyebrowX = storeData.CoreData.EyebrowX; EyebrowY = storeData.CoreData.EyebrowY; NoseType = storeData.CoreData.NoseType; NoseScale = storeData.CoreData.NoseScale; NoseY = storeData.CoreData.NoseY; MouthType = storeData.CoreData.MouthType; MouthColor = storeData.CoreData.MouthColor; MouthScale = storeData.CoreData.MouthScale; MouthAspect = storeData.CoreData.MouthAspect; MouthY = storeData.CoreData.MouthY; BeardColor = storeData.CoreData.BeardColor; BeardType = storeData.CoreData.BeardType; MustacheType = storeData.CoreData.MustacheType; MustacheScale = storeData.CoreData.MustacheScale; MustacheY = storeData.CoreData.MustacheY; GlassType = storeData.CoreData.GlassType; GlassColor = storeData.CoreData.GlassColor; GlassScale = storeData.CoreData.GlassScale; GlassY = storeData.CoreData.GlassY; MoleType = storeData.CoreData.MoleType; MoleScale = storeData.CoreData.MoleScale; MoleX = storeData.CoreData.MoleX; MoleY = storeData.CoreData.MoleY; Reserved = 0; }
//モグラの初期化処理 private void MoleInit() { isUp = false; onClick = false; moleAppearanceTime = 0.0f; Settings.Instance.SetSettings(); moleBeingTime = Settings.Instance.CurrentSettings.BeingTime; hitAnimTime = 1.0f; //キャラのランダム設定(難易度によって確率変更) if (difficalty == 3) { rand_char = Random.Range(1, 3 + 1); } else if (difficalty == 4) { rand_char = Random.Range(1, 2 + 1); } else { rand_char = Random.Range(1, 5 + 1); } if (rand_char == 1) { rand_notMole = Random.Range(0, 2); if (rand_notMole == 0) { //キノコに設定 mole.sprite = mushroomSprite[0]; type = MoleType.Mushroom; } else { //モグラ(メス)に設定 mole.sprite = moleGirlSprite[0]; type = MoleType.Girl; } } else { //モグラに設定 mole.sprite = moleSprite[0]; type = MoleType.Mole; } if (mole.sprite == moleSprite[0]) { moleGameManager.MoleCountPlus(); } state = MoleState.Move; }
public void Set(bool isShiny, bool isHidden, float distance, MoleType moleType) { m_arrayInputs[0] = Utilities.BoolToFloat(isShiny); m_arrayInputs[1] = Utilities.BoolToFloat(isHidden); m_arrayInputs[2] = distance / Const.MAX_DISTANCIA; for (int i = 3; i < m_arrayInputs.Length; i++) { m_arrayInputs[i] = 0.0f; } m_arrayInputs[(byte)moleType + 3] = 1.0f; }
public void SetTagIdx(MoleType type) { spRenderer = GetComponent <SpriteRenderer> (); if (type == MoleType.MOLE_RIGHT) { //right Tag spRenderer.sprite = RightTagList[Random.Range(0, RightTagList.Length)]; } else if (type == MoleType.MOLE_WRONG) { spRenderer.sprite = WrongTagList[Random.Range(0, WrongTagList.Length)]; } else { spRenderer.sprite = DangerTag; } }
public void Hit() { switch (m_currMole) { case MoleType.Normal: // REMOVE SCORE m_currState = MoleState.Hit; Debug.Log("Normal Mole Hit"); m_moleManager.GetComponent <MoleGameManagerScript>().IncrementScore(-10, this.transform.position.x, this.transform.position.y); break; case MoleType.Frozen: if (m_hitOnce == false) { Debug.Log("Ice Mole Hit"); m_hitOnce = true; m_moleManager.GetComponent <MoleGameManagerScript>().IncrementScore(5, this.transform.position.x, this.transform.position.y); } else { m_currMole = MoleType.Normal; this.GetComponent <SpriteRenderer>().sprite = moleSprites[(int)m_currMole]; Debug.Log("Ice Mole Convert"); animtor.Play("NormalIDLE"); m_moleManager.GetComponent <MoleGameManagerScript>().IncrementScore(15, this.transform.position.x, this.transform.position.y); } break; case MoleType.Evil: m_currState = MoleState.Hit; Debug.Log("Bad Mole Hit"); m_moleManager.GetComponent <MoleGameManagerScript>().IncrementScore(20, this.transform.position.x, this.transform.position.y); break; default: break; } }
public ANN_MoleInput(bool isShiny, bool isHidden, float distance, MoleType moleType) { Set(isShiny, isHidden, distance, moleType); }