public Actor() { _view = MiniPool.Create(PrefabName.Actor, new Vector3(0f, -2.25f, 0f)); _transform = _view.transform; _bodyTransform = _transform.GetChild(0); _particleSystem = _transform.GetChild(1).GetComponent <ParticleSystem>(); _view.AddComponent <CollisionHelper>().Init(OnCollision); }
public void Init(ObstacleTemplate template, Color color) { _view = MiniPool.Create(template.PrefabName, new Vector3(0f, 0f, 100f)); _transform = _view.transform; _transform.localEulerAngles = new Vector3(0f, 0f, template.StartAngle); _behaviour = ObstacleUtils.GetBehaviour(template.BehaviourType); if (_behaviour != null) { _behaviour.Init(_transform, template.Direction); } IsActive = true; _scaleTimer = 0f; foreach (var renderer in _view.GetComponentsInChildren <Renderer>()) { renderer.material.SetColor("_MainColor", color); } }
public Gem() { _view = MiniPool.Create(PrefabName.Gem, new Vector3(0f, -2.25f, 100f)); _transform = _view.transform; _view.AddComponent <CollisionHelper>().Init(OnCollision); }
public Tube() { var view = MiniPool.Create(PrefabName.Tube, Vector3.zero); _material = view.GetComponent <MeshRenderer>().material; }