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;
 }
Ejemplo n.º 2
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;
 }