public SushiRenderer(SushiType type, string[] names, SwitchableSushi parent)
 {
     this.type = type;
     this.renderers = new MeshRenderer[names.Length];
     for (int i = 0; i < names.Length; i++) {
         this.renderers[i] = parent.findRendererByName (names[i]);
     }
 }
 void Start()
 {
     curtain = GameObject.Find ("Curtain").GetComponent<Curtain> ();
     maxSpeedText = GameObject.Find ("MaxSpeedText").GetComponent<Text> ();
     accelerationText = GameObject.Find ("AccelerationText").GetComponent<Text> ();
     weightText = GameObject.Find ("WeightText").GetComponent<Text> ();
     maxSpeedMeterText = GameObject.Find ("MaxSpeedMeter").GetComponent<Text> ();
     accelerationMeterText = GameObject.Find ("AccelerationMeter").GetComponent<Text> ();
     weightMeterText = GameObject.Find ("WeightMeter").GetComponent<Text> ();
     hideSpecs ();
     soundManager = GameObject.Find ("Sounds").GetComponent<SoundManager> ();
     keyConfig = KeyConfig.Current;
     switchableSushi = GameObject.Find("SwitchableSushi").GetComponent<SwitchableSushi>();
     maxSushi = Enum.GetValues (typeof(SushiType)).Length;
     currentSushi = SushiType.Amaebi;
     switchableSushi.InitializeRenderer ();
     switchableSushi.SwitchSushi (currentSushi);
     message = GameObject.Find ("Message");
     fuda = GameObject.Find ("Fuda");
     fudaSprites = new Sprite[] {
         AmaebiSprite,
         EbiSprite,
         HamachiSprite,
         HokkiSprite,
         IkaSprite,
         IkuraSprite,
         KohadaSprite,
         OotoroSprite,
         MaguroSprite,
         SulmonSprite,
         TakoSprite,
         TamagoSprite,
         UniSprite
     };
     frame = 0;
     hideSprites ();
     initFudaPosition ();
     isSelected = false;
     isReturn = false;
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     keyConfig = KeyConfig.Current;
     soundManager = GameObject.Find ("UserInterface").GetComponent<SoundManager> ();
     courseFactory = GameObject.Find ("Course").GetComponent<CourseFactory> ();
     courseFactory.CreateCourse ();
     if (!IsObj) {
         lastIntersectedFloor = courseFactory.Floor;
     }
     if (IsSushi) {
         switchableSushi = GetComponentInChildren<SwitchableSushi> ();
         switchableSushi.InitializeRenderer ();
         if (IsAI) {
             int maxSushi = Enum.GetValues (typeof(SushiType)).Length;
             int sushiType = UnityEngine.Random.Range (0, maxSushi);
             switchableSushi.SwitchSushi ((SushiType)sushiType);
         } else {
             switchableSushi.SwitchSushi (Global.CurrentSushiType);
             SushiSpec spec = SushiSpecProvider.Provide (Global.CurrentSushiType);
             maxSpeed = spec.MaxSpeed;
             acceleration = spec.Acceleration;
             speedDecrFactor = spec.Weight;
         }
     }
     floatingEffect = GameObject.Find("FloatingEffect").GetComponent<ParticleSystem> ();
     floatingEffect.enableEmission = false;
 }