Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
 public Gem()
 {
     _view      = MiniPool.Create(PrefabName.Gem, new Vector3(0f, -2.25f, 100f));
     _transform = _view.transform;
     _view.AddComponent <CollisionHelper>().Init(OnCollision);
 }
Exemple #4
0
        public Tube()
        {
            var view = MiniPool.Create(PrefabName.Tube, Vector3.zero);

            _material = view.GetComponent <MeshRenderer>().material;
        }