Beispiel #1
0
    public void reset()
    {
        this.allCollidedFloors = new HashSet <GameObject>();
        this.currFloor         = LevelPropertiesScript.sharedInstance().floor;

        if (GameProperties.gameType == GameType.kGameTypeMominoTargets)
        {
            Vector3 firstPowerupPos  = (Vector3)ShortestPathScript.sharedInstance().checkpoints[0];
            Vector3 secondPowerupPos = (Vector3)ShortestPathScript.sharedInstance().checkpoints[1];
            Vector3 firstDirection   = (secondPowerupPos - firstPowerupPos);

            this.transform.position = (firstPowerupPos - firstDirection.normalized);
            this.transform.rotation = Quaternion.LookRotation(firstDirection);
        }
        else
        {
            this.transform.position = new Vector3(0, this.transform.localScale.y * 0.5f, 0);
            this.transform.rotation = Quaternion.Euler(0, 0, 0);
        }
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        this.labelsStyle             = new GUIStyle();
        labelsStyle.normal.textColor = Color.black;
        if (GameProperties.IsTactil())
        {
            labelsStyle.fontSize = 15;
        }

        switch (GameProperties.gameType)
        {
        case GameType.kGameTypeMominoTargets:
            this.maxNDominos = (int)(ShortestPathScript.sharedInstance().minRequiredDominos() * 1.35f);
            break;

        case GameType.kGameTypeGod:
            this.maxNDominos = 1000;
            break;

        case GameType.kGameTypeMomino:
        default:
            this.maxNDominos = -1;
            break;
        }

        if (this.allSteps == null)
        {
            this.allSteps = new HashSet <GameObject>();
        }

        if (GameProperties.gameType == GameType.kGameTypeMominoTargets)
        {
            ShortestPathScript.sharedInstance().calculateCheckpoints();
            ShortestPathScript.sharedInstance().instantiatePath();
        }

        MominoScript.sharedInstance().reset();
        MominoScript.sharedInstance().gameObject.SetActive(GameProperties.gameType != GameType.kGameTypeGod);

        this.enableFirstCamera();
    }
 void OnDestroy()
 {
     ShortestPathScript.singleton = null;
 }
 void Awake()
 {
     ShortestPathScript.singleton = this;
 }
Beispiel #5
0
 void OnDestroy()
 {
     ShortestPathScript.singleton = null;
 }
Beispiel #6
0
 void Awake()
 {
     ShortestPathScript.singleton = this;
 }