Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        panel = GameObject.Find("Panel");
        gameoverPanel = GameObject.Find("gameoverPanel");

        NGUITools.SetActive(gameoverPanel, false);
        NGUITools.SetActive(panel, true);

        Time.timeScale = 1.0f;

        gameover = false;

        timer = GameProperties.timeAmount;
        score = 0;

        spawnObject = Resources.Load<clickObjectScript>("clickObjectPref");

        objectFabric = new Fabric(spawnObject);

        scoreLabel = GameObject.Find("scoreLabel").GetComponent<UILabel>();
        scoreLabel.text = "Score: " + score.ToString();

        timerLabel = GameObject.Find("timerLabel").GetComponent<UILabel>();
        timerLabel.text = "Time: " + Mathf.CeilToInt(timer).ToString();
    }
Beispiel #2
0
 public void DisableObject(clickObjectScript o)
 {
     if (activeObjects.Contains(o))
     {
         activeObjects.Remove(o);
         if (!inactiveObjects.Contains(o))
         {
             inactiveObjects.Add(o);
             o.gameObject.SetActive(false);
         }
     }
 }
Beispiel #3
0
    public Fabric(clickObjectScript so)
    {
        typeProbabilities = GameProperties.typeProbabilities;

        spawnDelay = GameProperties.spawnDelay;

        activeObjects = new List<clickObjectScript>();
        inactiveObjects = new List<clickObjectScript>();

        spawnTimer = 0.0f;

        spawnObject = so;
    }
Beispiel #4
0
 public virtual void InitObject(clickObjectScript scr, ClickObjectTrajectory tr, float vel)
 {
     BaseInit(scr, tr, vel);
 }
Beispiel #5
0
 public override void InitObject(clickObjectScript scr, ClickObjectTrajectory tr, float vel)
 {
     base.InitObject(scr, tr, vel);
 }
Beispiel #6
0
 public override void InitObject(clickObjectScript scr, ClickObjectTrajectory tr, float vel)
 {
     BaseInit(scr, tr, vel);
     score = 1;
 }
Beispiel #7
0
    protected void BaseInit(clickObjectScript scr, ClickObjectTrajectory tr, float vel)
    {
        trajectory = tr;
        velocity = vel;

        colData = null;

        beingDestroyed = false;
        almostBonus = false;

        score = 1;

        view = scr;

        view.SetVelocity(trajectory, velocity);
        view.SetColor(GetObjectColor(type));
    }
 public void MakeBonus(clickObjectScript scr)
 {
     ClickObject newClickObject = CreateClickObject(ClickObjectType.bonusObject);
     newClickObject.InitObject(scr, ClickObjectTrajectory.hold, 0.0f);
     clickObject = newClickObject;
 }
 public void InitObject(clickObjectScript scr, ClickObjectType t, ClickObjectTrajectory tr, float vel)
 {
     clickObject = CreateClickObject(t);
     clickObject.InitObject(scr, tr, vel);
 }
 public ClickObjectController(clickObjectScript scr, ClickObjectType t, ClickObjectTrajectory tr, float vel)
 {
     InitObject(scr, t, tr, vel);
 }