public override void SetToStickman(Stickman stickman, StickmanPart part) { base.SetToStickman(stickman, part); if (base.Stickman != null) { this._time = Time.time + UnityEngine.Random.Range(0f, this._rechargeTime); } }
public void WhenMake2DicesGame_ShouldSucced() { var game = new Game(); var stickman = new Stickman(); stickman.AddDice(game); Assert.Equal(2, game.DiceCount); }
public static Stickman Create(string name, CharPose charpose) { GameObject obj = new GameObject(name); obj.SetActive(false); Stickman stickman = obj.AddComponent <Stickman>(); stickman._charPose = charpose; stickman._spine = stickman.CreatePart("Spine", null, charpose.spine_mass, (int)charpose.spine_limit, (int)charpose.spine_angle); stickman._head = stickman.CreatePart("Head", stickman._spine, charpose.head_mass, (int)charpose.head_limit, (int)charpose.head_angle); stickman._upArmL = stickman.CreatePart("UpArmL", stickman._spine, charpose.upArmL_mass, (int)charpose.upArmL_limit, (int)charpose.upArmL_angle); stickman._upArmR = stickman.CreatePart("UpArmR", stickman._spine, charpose.upArmR_mass, (int)charpose.upArmR_limit, (int)charpose.upArmR_angle); stickman._downArmR = stickman.CreatePart("DownArmR", stickman._upArmR, charpose.downArmR_mass, (int)charpose.downArmR_limit, (int)charpose.downArmR_angle); stickman._downArmL = stickman.CreatePart("DownArmL", stickman._upArmL, charpose.downArmL_mass, (int)charpose.downArmL_limit, (int)charpose.downArmL_angle); stickman._upLegL = stickman.CreatePart("UpLegL", stickman._spine, charpose.upLegL_mass, (int)charpose.upLegL_limit, (int)charpose.upLegL_angle); stickman._upLegR = stickman.CreatePart("UpLegR", stickman._spine, charpose.upLegR_mass, (int)charpose.upLegR_limit, (int)charpose.upLegR_angle); stickman._downLegL = stickman.CreatePart("DownLegL", stickman._upLegL, charpose.downLegL_mass, (int)charpose.downLegL_limit, (int)charpose.downLegL_angle); stickman._downLegR = stickman.CreatePart("DownLegR", stickman._upLegR, charpose.downLegR_mass, (int)charpose.downLegR_limit, (int)charpose.downLegR_angle); stickman._spine.Stickman = stickman; stickman._head.Stickman = stickman; stickman._upArmL.Stickman = stickman; stickman._upArmR.Stickman = stickman; stickman._downArmR.Stickman = stickman; stickman._downArmL.Stickman = stickman; stickman._upLegL.Stickman = stickman; stickman._upLegR.Stickman = stickman; stickman._downLegL.Stickman = stickman; stickman._downLegR.Stickman = stickman; stickman._headRigid = stickman._head.GetComponent <Rigidbody2D>(); bool flag = true; stickman._head.CanHit = flag; stickman._head.CanGetHit = flag; flag = true; stickman._spine.CanGetHit = flag; flag = true; stickman._downLegR.CanHit = flag; stickman._downLegL.CanHit = flag; stickman._downArmR.CanHit = flag; stickman._downArmL.CanHit = flag; flag = true; stickman._upLegR.CanGetHit = flag; stickman._upLegL.CanGetHit = flag; stickman._upArmR.CanGetHit = flag; stickman._upArmL.CanGetHit = flag; //stickman.UpdateMass(); stickman.UpdateSize(); stickman.UpdateJoints(); obj.SetActive(true); return(stickman); }
public Game Build() { var game = new Casino().CreateGame(0); game.LuckyNumber = luckyNumber; if (diceNumber == 2) { var stickman = new Stickman(); stickman.AddDice(game); } return(game); }
public override void SetToStickman(Stickman stickman, StickmanPart part) { base.SetToStickman(stickman, part); if (((base.Stickman != null) && (base.Stickman.CurrentHealth > 0)) && (this._collider != null)) { Collider[] componentsInChildren = base.Stickman.GetComponentsInChildren <Collider>(); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != this._collider) { Physics.IgnoreCollision(componentsInChildren[i], this._collider, true); } } } }
private void SpawnMan() { int h = Random.Range(0, levels.Length); GameObject nextMan = Instantiate(stickman); nextMan.transform.position = new Vector3(-11, levels[h].position.y, 0); nextMan.layer = levels[h].gameObject.layer + 7; Stickman s = nextMan.GetComponent <Stickman>(); s.target = levels[h].GetChild(0); s.Init(); s.SetTarget(Castle.Instance.GetDestroyable()); s.OnDieEvent += Counter.Instance.StickmanDeath; }
private void Tick(object sender, object e) { counter = (counter + 1) % 8; Stickman.Source = images[counter]; speed += 1; stickR.Y = Math.Min(200, stickR.Y + speed); Stickman.SetValue(Canvas.TopProperty, stickR.Y); boxR.X = (boxR.X > -100) ? boxR.X - 10 : 600; Box.SetValue(Canvas.LeftProperty, boxR.X); if (RectHelper.Intersect(boxR, stickR) != Rect.Empty) { GameOver.Visibility = Visibility.Visible; timer.Stop(); } }
public void Update5(Stickman s) { s.Score += 5; }
public void Update1(Stickman s) { s.Score++; }
// Use this for initialization void Start() { player = Stickman.Create("fsq", CharFactory.Instance.Create("char_0001")); enemy = Stickman.Create("enemy", CharFactory.Instance.Create("char_0001")); }
public void Handle(Stickman s) { s.Y = 4.5F; s.Skok = true; }
public void Handle(Stickman s) { s.Y = 0; s.Skok = false; }