static void Hero() { var client = new GothamCity(); var poisonIvy = new PoisonIvy(); client.HandleVillain(poisonIvy); Console.WriteLine(poisonIvy); var clayface = new Clayface(); client.HandleVillain(clayface); Console.WriteLine(clayface); var joker = new Joker(); client.HandleVillain(joker); Console.WriteLine(joker); try { var bane = new Bane(); client.HandleVillain(bane); } catch (Exception e) { Console.WriteLine(e.Message); } }
public MouseUtil(float speed, float masatsu, int catmullResolution, Transform tgtTransform = null) { _isLimit = false; //tgtTransform ? true : false; _catmullResolution = catmullResolution; if (_catmullResolution <= 2) { _isCatmull = false; } //Debug.Log("isLimit " + _isLimit + " " + (tgtTransform==null) ); _bane = new Bane( new Vector3( speed + 0.1f * speed * (Random.value - 0.5f), speed + 0.1f * speed * (Random.value - 0.5f), speed + 0.1f * speed * (Random.value - 0.5f) ), new Vector3( masatsu + 0.1f * masatsu * (Random.value - 0.5f), masatsu + 0.1f * masatsu * (Random.value - 0.5f), masatsu + 0.1f * masatsu * (Random.value - 0.5f) ) ); velocity = Vector3.zero; position = Vector3.zero; positions = new List <Vector3>(); for (int i = 0; i < NUM; i++) { positions.Add(Vector3.zero); } if (_isCatmull) { _catmull = new CatmullRom(positions.ToArray(), _catmullResolution, false); } tangents = new Vector3[NUM]; rotations = new List <float>(); oldPosition = Vector3.zero; oldTargetPos = Vector3.zero; _tgtTransform = tgtTransform; }