コード例 #1
0
    public static void useInspectable()
    {
        switch (CastRay.detected.name)
        {
        case "card_slot":
            InventoryManager.storageIcon.SetActive(true);
            Destroy(GameObject.Find("card_slot").GetComponent <Inspectable>());
            Destroy(GameObject.Find("card_slot").GetComponent <Collider>());
            MasterScript.cardFound = true;
            WindowManager.cameraStorage.SetActive(true);
            WindowManager.windowDefaultText.SetActive(false);
            MasterScript.showMessage("Item Found: Memeory Card");

            break;


        case "passwordLocation":
            InventoryManager.passwordIcon.SetActive(true);
            Destroy(GameObject.Find("passwordLocation").GetComponent <Inspectable>());
            Destroy(GameObject.Find("passwordLocation").GetComponent <Collider>());
            MasterScript.passwordFound = true;
            MasterScript.showMessage("Item Found: Computer Password");
            break;

        default:
            break;
        }
    }
コード例 #2
0
        public void Execute()
        {
            // Open database (or create if not exits)
            var defaultFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                                 "SDL Community", "AhkMasterScript");

            if (!Directory.Exists(defaultFolderPath))
            {
                Directory.CreateDirectory(defaultFolderPath);
            }
            var defaultDbPath = Path.Combine(defaultFolderPath, "Ahk.db");

            using (var db = new LiteDatabase(defaultDbPath))
            {
                var masterScriptCollection = db.GetCollection <MasterScript>("masterScript");
                var masterScript           = masterScriptCollection.FindOne(m => m.Name.Contains("AhkMasterScript.ahk"));
                if (masterScript != null)
                {
                    return;
                }

                //create master script if does not exist
                var master = new MasterScript
                {
                    Id       = 1,
                    Name     = "AhkMasterScript.ahk",
                    Location = defaultFolderPath,
                    Scripts  = new List <Script>()
                };
                masterScriptCollection.Insert(master);
            }
        }
コード例 #3
0
    private void Update()
    {
        if (MasterScript.cameraFunctionsScript.openMenu == true)                                                       //If the menu should be open
        {
            NGUITools.SetActive(MasterScript.systemPopup.overlayContainer, false);                                     //Disable all the overlays

            if (MasterScript.playerTurnScript.tempObject != null)                                                      //If there is a selected system
            {
                selectedSystem = MasterScript.RefreshCurrentSystem(MasterScript.cameraFunctionsScript.selectedSystem); //Get references to the required scripts
                systemSIMData  = MasterScript.playerTurnScript.tempObject.GetComponent <SystemSIMData>();
            }

            CheckActiveElements();
            UpdateOverview();
            CheckSystemSize();
        }

        if (MasterScript.cameraFunctionsScript.openMenu == false)                 //If the menu should be closed
        {
            NGUITools.SetActive(MasterScript.systemPopup.overlayContainer, true); //Enable the overlays

            if (playerSystemInfoScreen.activeInHierarchy == true)                 //If there are any menu components active
            {
                NGUITools.SetActive(playerSystemInfoScreen, false);               //Disable them
                selectedPlanet = -1;                                              //Reset the selected planet
                systemScrollviews.selectedPlanet = -1;
            }
        }
    }
コード例 #4
0
    private void CheckFrontLineBonus()
    {
        flResourceModifier = 1f;
        flgrowthModifier   = 1f;
        flOffDefModifier   = 1f;

        int noSystems = 0;

        for (int i = 0; i < MasterScript.systemListConstructor.systemList[thisSystem].permanentConnections.Count; ++i)
        {
            int neighbour = MasterScript.RefreshCurrentSystem(MasterScript.systemListConstructor.systemList[thisSystem].permanentConnections[i]);

            if (MasterScript.systemListConstructor.systemList[neighbour].systemOwnedBy != null && MasterScript.systemListConstructor.systemList[neighbour].systemOwnedBy != thisPlayer.playerRace)
            {
                DiplomaticPosition temp = MasterScript.diplomacyScript.ReturnDiplomaticRelation(MasterScript.systemListConstructor.systemList[thisSystem].systemOwnedBy, MasterScript.systemListConstructor.systemList[neighbour].systemOwnedBy);

                flResourceModifier += temp.resourceModifier;
                flgrowthModifier   += temp.growthModifier;
                flOffDefModifier   += temp.offDefModifier;
                ++noSystems;
            }
        }

        if (noSystems != 0)
        {
            flResourceModifier = flResourceModifier / noSystems;
            flgrowthModifier   = flgrowthModifier / noSystems;
            flOffDefModifier   = flOffDefModifier / noSystems;
        }
    }
コード例 #5
0
    private void Awake()
    {
        MasterScript.ScriptReferences();
        mapSize = PlayerPrefs.GetInt("Map Size");
        PlanetRead();
        SystemRead();
        HeroTechTree.ReadTechFile();
        SelectSystemsForMap();
        CheckSystem();
        CreateObjects();
        MasterScript.mapConstructor.DrawMinimumSpanningTree();

        //voronoiGenerator.CreateVoronoiCells ();

        ambientStars = GameObject.Find("ScriptsContainer").GetComponent <AmbientStarRandomiser> ();
        ambientStars.GenerateStars();

        LoadBasicTechTree();

        for (int i = 0; i < systemList.Count; ++i)
        {
            LineRenderScript lineRenderScript = systemList[i].systemObject.GetComponent <LineRenderScript>();

            lineRenderScript.StartUp();
        }

        //systemPopup.LoadOverlays ();

        MasterScript.galaxyGUI.SelectRace(PlayerPrefs.GetString("Player Race"));
        loaded = true;
    }
コード例 #6
0
 void Start()
 {
     master    = GameObject.FindGameObjectWithTag("MasterScript").GetComponent <MasterScript>();
     inventory = GetComponent <PlayerInventory>();
     shoot     = GetComponent <PlayerShoot>();
     stats     = GetComponent <PlayerStats>();
 }
コード例 #7
0
    private void CheckVisitedSystems()
    {
        bool foundSystem = false;

        for (int i = 0; i < firmSystems.Count; ++i)        //For all current systems
        {
            int sys = MasterScript.RefreshCurrentSystem(firmSystems [i]);

            for (int j = 0; j < MasterScript.systemListConstructor.systemList[sys].permanentConnections.Count; ++j)            //Check the systems permanent connections
            {
                if (firmSystems.Contains(MasterScript.systemListConstructor.systemList[sys].permanentConnections[j]))          //If the system is already in firm systems, ignore it
                {
                    continue;
                }

                firmSystems.Add(MasterScript.systemListConstructor.systemList[sys].permanentConnections[j]);         //Add systems to firm systems
                unvisitedSystems.Remove(MasterScript.systemListConstructor.systemList[sys].permanentConnections[j]); //Remove the system from unvisited systems

                foundSystem = true;                                                                                  //Found a system
            }
        }

        if (foundSystem == true)        //If system is found
        {
            CheckVisitedSystems();      //Repeat
        }
    }
コード例 #8
0
    private void UpdateVariables()
    {
        if (MasterScript.playerTurnScript.playerRace != null && MasterScript.cameraFunctionsScript.selectedSystem != null)
        {
            knowledgeString = ((int)MasterScript.playerTurnScript.knowledge).ToString();
            powerString     = ((int)MasterScript.playerTurnScript.power).ToString();
            wealthString    = ((int)MasterScript.playerTurnScript.wealth).ToString();
            turnNumber      = "Year: " + (2200 + (int)(MasterScript.turnInfoScript.turn / 2f)).ToString();
            selectedSystem  = MasterScript.RefreshCurrentSystem(MasterScript.cameraFunctionsScript.selectedSystem);

            if (MasterScript.systemListConstructor.systemList[selectedSystem].systemOwnedBy == null)
            {
                NGUITools.SetActive(coloniseButton, true);

                if (MasterScript.playerTurnScript.playerRace == "Nereides")
                {
                    float totalPower  = 20;
                    float totalWealth = 10;

                    for (int i = 0; i < MasterScript.systemListConstructor.systemList[selectedSystem].systemSize; ++i)
                    {
                        totalWealth += MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[i].wealthValue;
                        totalPower  += ((float)MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[i].wealthValue / 3f) * 20f;
                    }

                    string cost = "Power: " + totalPower + "\nWealth: " + totalWealth;

                    snapColoniseButton.GetComponent <UILabel>().text = cost;

                    NGUITools.SetActive(snapColoniseButton, true);
                }
            }
        }
    }
コード例 #9
0
ファイル: Ball.cs プロジェクト: Christoph-M/PongKlohn
    //____________________________________________________________\\\\\\___MonoMethods___//////_______________________________________________________________
    //_________________\\\\\\___Awake___//////_________________
    // Calculates wall positions and goal posts + sets
    // character + resets path
    //‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
    void Awake()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        gameScript = GameObject.FindObjectOfType (typeof(Game)) as Game;

        moveScript = GameObject.FindObjectOfType (typeof(Move)) as Move;
        sinCosMovementScript = GameObject.FindObjectOfType (typeof(SinCosMovement)) as SinCosMovement;
        linearRotationScript = GameObject.FindObjectOfType (typeof(LinearRotation)) as LinearRotation;
        sinCosRotationScript = GameObject.FindObjectOfType (typeof(SinCosRotation)) as SinCosRotation;

        this.name = "Projectile";

        bounceCount = 0;

        wallTop    =  fieldHeight / 2;
        wallBottom = -fieldHeight / 2;
        wallRight  =  fieldWidth  / 2;
        wallLeft   = -fieldWidth  / 2;
        goalTop    =  goalHeight  / 2;
        goalBottom = -goalHeight  / 2;

        p1char = masterScript.GetCharacter (1) - 1;
        p2char = masterScript.GetCharacter (2) - 1;

        this.ResetPath ();
    }
コード例 #10
0
    private void UpdateConnections()
    {
        for (int i = 0; i < MasterScript.systemListConstructor.systemList[connectionIterator].permanentConnections.Count; ++i)        //For all connections
        {
            bool validConnection = true;

            if (MasterScript.mapConstructor.IsValidConnection(MasterScript.systemListConstructor.systemList[connectionIterator].systemObject, MasterScript.systemListConstructor.systemList[connectionIterator].permanentConnections[i]) == false)
            {
                validConnection = false;
            }

            if (validConnection == false)
            {
                GameObject target = MasterScript.systemListConstructor.systemList[connectionIterator].permanentConnections[i];

                if (ReconnectSystems(MasterScript.systemListConstructor.systemList[connectionIterator].systemObject, target))
                {
                    ReconnectSystems(target, MasterScript.systemListConstructor.systemList[connectionIterator].systemObject);
                    RemoveConnection(connectionIterator, MasterScript.RefreshCurrentSystem(target));
                }
            }
        }

        connectionIterator++;

        if (connectionIterator == MasterScript.systemListConstructor.systemList.Count)
        {
            connectionIterator = 0;
        }
    }
コード例 #11
0
    void Start()
    {
        master = GameObject.FindGameObjectWithTag("MasterScript").GetComponent <MasterScript>();
        rb     = GetComponent <Rigidbody2D>();

        health = maxHealth;
    }
コード例 #12
0
    public void MakeTeams()
    {
        List <PlayerData> activePlayers = new List <PlayerData>();

        alpha.Clear();
        bravo.Clear();
        unactivePlayers.Clear();

        // Seperate selected and unselected players
        GameObject[] objs = GameObject.FindGameObjectsWithTag("Toggle");
        for (int i = 0; i < objs.Length; i++)
        {
            if (objs[i].GetComponent <Toggle>().isOn)
            {
                activePlayers.Add(MasterScript.playerData[i]);
            }
            else
            {
                unactivePlayers.Add(MasterScript.playerData[i]);
            }
        }

        // Balance teams
        MasterScript.BalanceTeams(activePlayers, out alpha, out bravo);
    }
コード例 #13
0
    private void Update()
    {
        if (!inventoryActive)
        {
            if (Input.GetKeyDown(KeyCode.Tab))
            {
                Cursor.lockState = CursorLockMode.Confined;
                inventory.SetActive(true);
                inventoryActive = true;
                MasterScript.CAM1.GetComponent <Camera_WASD_movement>().enabled = false;
                MasterScript.EnableDOF();
            }
        }
        else if (inventoryActive)
        {
            if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Tab))
            {
                Cursor.lockState = CursorLockMode.Locked;
                inventory.SetActive(false);
                inventoryActive = false;
                MasterScript.DisableDOF();
                MasterScript.CAM1.GetComponent <Camera_WASD_movement>().enabled = true;
            }
        }

        /*
         * if (inventory.GetComponent<Rigidbody>() != null)
         * {
         *  Destroy(inventory.GetComponent<Rigidbody>());
         * }*/
    }
コード例 #14
0
    public void StartUp()
    {
        connectorLineContainer = GameObject.Find("Connector Lines Container").transform;
        thisSystem             = MasterScript.RefreshCurrentSystem(gameObject);

        CreateLines();
    }
コード例 #15
0
ファイル: PlayerTurn.cs プロジェクト: Shemamforash/Crucible
    public void StartTurn()
    {
        isPlayer = true;

        PickRace();

        MasterScript.cameraFunctionsScript.selectedSystem       = GameObject.Find(homeSystem);    //Set the selected system
        MasterScript.cameraFunctionsScript.selectedSystemNumber = MasterScript.RefreshCurrentSystem(MasterScript.cameraFunctionsScript.selectedSystem);
        MasterScript.turnInfoScript.systemsInPlay++;

        int i = MasterScript.RefreshCurrentSystem(MasterScript.cameraFunctionsScript.selectedSystem);

        MasterScript.systemListConstructor.systemList[i].systemOwnedBy = playerRace;

        //voronoiGenerator.voronoiCells[i].renderer.material = materialInUse;
        //voronoiGenerator.voronoiCells[i].renderer.material.shader = Shader.Find("Transparent/Diffuse");

        for (int j = 0; j < MasterScript.systemListConstructor.systemList[i].systemSize; ++j)
        {
            if (MasterScript.systemListConstructor.systemList[i].planetsInSystem[j].planetType == homePlanetType)
            {
                MasterScript.systemListConstructor.systemList[i].planetsInSystem[j].planetColonised = true;
                break;
            }
        }

        Vector3 temp = MasterScript.systemListConstructor.systemList [i].systemObject.transform.position;

        MasterScript.systemPopup.mainCamera.transform.position = new Vector3(temp.x, temp.y, -45f);
    }
コード例 #16
0
    // Use this for initialization
    void Start()
    {
        animator = this.GetComponent <Animator>();
        GameObject masterGameObject = GameObject.Find("MasterGameObject");

        this.masterScript = masterGameObject.GetComponent <MasterScript>();
    }
コード例 #17
0
    void Start()
    {
        master   = GameObject.FindGameObjectWithTag("MasterScript").GetComponent <MasterScript>();
        animator = GetComponent <Animator>();
        rb       = GetComponent <Rigidbody2D>();

        player = GameObject.FindGameObjectWithTag("Player");
    }
コード例 #18
0
    public void BravoWon()
    {
        float alphaChange = MasterScript.CalculateMatchRewards(leaderboardScript.alpha, leaderboardScript.bravo, false, MasterScript.matchPower);
        float bravoChange = -alphaChange;

        // Update Scores
        UpdateScores(alphaChange, bravoChange, false);
    }
コード例 #19
0
 // Use this for initialization
 void Start()
 {
     if (master != this)
     {
         master = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #20
0
 void Start()
 {
     doorSound           = GetComponent <AudioSource>();
     RedKeyLockScript    = RedKeyLock.GetComponent <Locks>();
     BlueKeyLockScript   = BlueKeyLock.GetComponent <Locks>();
     YellowKeyLockScript = YellowKeyLock.GetComponent <Locks>();
     ms = PlayerReference.GetComponent <MasterScript>();
 }
コード例 #21
0
 /// <summary>
 /// Checks whether collision is with an enemy and kills the player if so.
 /// </summary>
 /// <param name="collision">The GameObject that collision occurred with.</param>
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.name == "Enemy" || collision.gameObject.tag == "Enemy")
     {
         eatingNoise.Play();
         MasterScript.KillPlayer(this);
     }
 }
コード例 #22
0
    public IEnumerator PullP2()
    {
        StartCoroutine(MasterScript.Pull("251", IsaiahsVars.varToAssign));

        yield return(new WaitForSeconds(.5f));

        Player2Space = IsaiahsVars.varToAssign;
    }
コード例 #23
0
ファイル: MasterScript.cs プロジェクト: MALDeJong1/YEPM
 /// <summary>
 ///     Instantiates MasterScript and spawns initial Player Character.
 /// </summary>
 void Start()
 {
     if (gameController == null)
     {
         gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <MasterScript>();
         SpawnPlayer();
     }
 }
コード例 #24
0
ファイル: Story.cs プロジェクト: Christoph-M/PongKlohn
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        video = (MovieTexture)GetComponent<Image> ().material.mainTexture;

        StartCoroutine (this.PlayStory ());
    }
コード例 #25
0
    public void AddPlayer()
    {
        string inputName = addPlayer.text;

        MasterScript.playerData.Add(new PlayerData {
            Name = inputName, Score = 1500
        });
        MasterScript.SaveData();
    }
コード例 #26
0
    void Update()
    {
        system = MasterScript.RefreshCurrentSystem(heroLocation);

        if (heroMovement.heroIsMoving == false)
        {
            gameObject.transform.position = heroMovement.HeroPositionAroundStar(heroLocation);
        }
    }
コード例 #27
0
 void MowedByLawnMower()
 {
     if (s*****d)
     {
         MasterScript master = GameObject.Find("/MasterObject").GetComponent <MasterScript>();
         master.SendMessage("ScoreUp", 20);
         Destroy(this.gameObject);
     }
 }
コード例 #28
0
    public void AlphaWon()
    {
        // Calculate match rewards
        float alphaChange = MasterScript.CalculateMatchRewards(leaderboardScript.alpha, leaderboardScript.bravo, true, MasterScript.matchPower);
        float bravoChange = -alphaChange;

        // Update Scores
        UpdateScores(alphaChange, bravoChange, true);
    }
コード例 #29
0
ファイル: LoginManager.cs プロジェクト: clasiqh/symphony
 public static void inputDeselected()
 {
     enterButtonGlow.SetActive(false);
     cursorObject.SetActive(false);
     passwordInput.SetActive(true);
     passwordInputGlow.SetActive(false);
     MasterScript.HideSubText();
     enterButtonGlow.SetActive(false);
 }
コード例 #30
0
ファイル: ActionScript.cs プロジェクト: RealoFoxtrot/HPCost
 public void Setup(SkillClass S, MasterScript M, GameObject G, Text F)
 {
     Sref      = S;
     TextUse   = S.NameSkill;
     DetailUse = S.DescribeSkill;
     Mref      = M;
     Detail    = G;
     Flavour   = F;
 }
コード例 #31
0
    void Start()
    {
        MS = GameObject.FindGameObjectWithTag("Master").GetComponent <MasterScript>();
        GameObject[] pointsA = GameObject.FindGameObjectsWithTag("Waypoint"); //assigns first segment to array of current points
        points.AddRange(pointsA);
        StartCoroutine(arraySetup());

        GotoNextPoint();
    }
コード例 #32
0
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        eventSystem = EventSystem.current;

        eventSystem.SetSelectedGameObject(firstSelectElement);
    }
コード例 #33
0
 public Task CreateMasterScript(MasterScript script)
 {
     using (var session = RavenContext.Current.CreateSession())
     {
         session.Store(script);
         session.SaveChanges();
     }
     return(Task.FromResult(true));
 }
コード例 #34
0
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;
        singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        eventSystem = EventSystem.current;

        eventSystem.SetSelectedGameObject(firstSelectElement);

        singleplayerScript.SetWinner (masterScript.GetCharacter(2));
        singleplayerScript.UpdateRound ();
    }
コード例 #35
0
ファイル: StartScreen.cs プロジェクト: Christoph-M/PongKlohn
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        video = (MovieTexture)backgroundVideo.material.mainTexture;

        eightBall = startScreen.transform.FindChild("8Ball").GetComponent<Image>();
        ga = startScreen.transform.FindChild("Game_Academy").GetComponent<Image>();
        pressStart = startScreen.transform.FindChild("Press_Start").GetComponent<Image>();

        StartCoroutine(this.StartUp ());
    }
コード例 #36
0
ファイル: Credits.cs プロジェクト: Christoph-M/PongKlohn
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        eventSystem = EventSystem.current;

        eventSystem.SetSelectedGameObject(firstSelectElement);

        startPos = credits.position;

        startTime = Time.time;

        StartCoroutine (ScrollNames ());
    }
コード例 #37
0
ファイル: MatchUI.cs プロジェクト: Christoph-M/PongKlohn
    void Awake()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        singleplayer = (masterScript.GetPlayerType (2) == "Ai") ? true : false;
        if (singleplayer) singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        eventSystem = EventSystem.current;

        gameScript = GameObject.FindObjectOfType (typeof(Game)) as Game;

        healthBarP1 = matchUI.transform.FindChild ("Health_P1").FindChild ("healthbar").GetComponent<Image> ();
        healthBarP2 = matchUI.transform.FindChild ("Health_P2").FindChild ("healthbar").GetComponent<Image> ();
        energyBarP1 = matchUI.transform.FindChild ("Energy_P1").FindChild ("specialbar").GetComponent<Image> ();
        energyBarP2 = matchUI.transform.FindChild ("Energy_P2").FindChild ("specialbar").GetComponent<Image> ();
    }
コード例 #38
0
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        eventSystem = EventSystem.current;

        eventSystem.SetSelectedGameObject(firstSelectElement);

        player1 = characterSelectionMenu.transform.FindChild ("Player1");
        player2 = characterSelectionMenu.transform.FindChild ("Player2");

        StartCoroutine (EnableStart ());
    }
コード例 #39
0
ファイル: Player.cs プロジェクト: Christoph-M/PongKlohn
    void Start()
    {
        animator = GetComponent<Animator>();
        curves = GameObject.FindObjectOfType (typeof(Curves)) as Curves;
        //audioDing = GameObject.FindObjectOfType (typeof(AudioLoop)) as AudioLoop;
        buffCoolDown = new Timer();
        catchTimer = new Timer();
        blockTimer  = new Timer();
        fireTimer = new Timer();
        stunTimer = new Timer();
        waitAfterSoot = new Timer();
        dashTimer = new Timer();
        buffTimer = new Timer();
        gameScript = GameObject.FindObjectOfType (typeof(Game)) as Game;
        masterScript = GameObject.FindObjectOfType(typeof(MasterScript)) as MasterScript;
        int c;
        if (this.tag == "Player1")
        {
            c = 1;
        }
        else
        {
            c = 2;
        }
        crystal = masterScript.GetCrystal(c);
           // animator = GetComponent<Animator>();
        myTransform = this.GetComponent<Rigidbody2D>();

        //var children = gameObject.GetComponentsInChildren<Transform>() as GameObject;// finde Trigger
        //foreach (var child in children)

        missTrigger.SetActive(false);
        blockTrigger.SetActive(false);

        //blockShild.SetActive(false);
        buffEffect.SetActive(false);

        wallTop = fieldHeight / 2;
        wallBottom = -fieldHeight / 2;
        wallRight = fieldWidth / 2;
        wallLeft = -fieldWidth / 2;

        dashCost = dashEnergyCost;

        if (InvertMotion) //Spieler Steht Links oder Recht   Steuerung anpassen
        {
            motionInverter = -1;
        } else {
            motionInverter = 1;
        }

        animator.SetBool("Start", true);
    }
コード例 #40
0
 void Start()
 {
     masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
     sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;
 }
コード例 #41
0
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;
        singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        eventSystem = EventSystem.current;

        crystalUnlocked = singleplayerScript.GetCrystalUnlockStatus ();

        for (int i = 0; i < crystalCount.Count; ++i) {
            crystalCount [i].text = "" + singleplayerScript.GetStartCrystalCount (i + 1);
            if (int.Parse (crystalCount [i].text) <= 0) {
                crystalCount [i].text = "" + 0;
                crystalCount [i].color = new Color32 (169, 0, 0, 255);

                temple [i].transform.FindChild ("1").gameObject.SetActive (false);
                temple [i].transform.FindChild ("0").gameObject.SetActive (true);
            }
        }

        StartCoroutine (this.UnlockSpecial ());
    }
コード例 #42
0
ファイル: Game.cs プロジェクト: Christoph-M/PongKlohn
    void Awake()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        singleplayer = (masterScript.GetPlayerType (2) == "Ai") ? true : false;
        if (singleplayer) singleplayerScript = GameObject.FindObjectOfType (typeof(Singleplayer)) as Singleplayer;

        StartCoroutine (SpawnGameObjects ());

        minBallSpeed = ballSpeedUpCurve.Evaluate (0.0f);
        maxBallSpeed = ballSpeedUpCurve.Evaluate (1.0f);
        ballSpeed = minBallSpeed;
    }
コード例 #43
0
ファイル: Singleplayer.cs プロジェクト: Christoph-M/PongKlohn
    void Start()
    {
        masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
        sceneHandlerScript = GameObject.FindObjectOfType (typeof(SceneHandler)) as SceneHandler;

        playerCrystalCount = playerStartCrystalCount;

        round = 1;
        match = 0;
        enemyCharacter = 1;

        for (int i = 0; i < aiCrystalCount.Count; ++i) {
            aiCrystalCount[i] = Random.Range (minStartAiCrystalCount, maxStartAiCrystalCount);
            aiStartCrystalCount[i] = aiCrystalCount [i];
            this.SetAiDifficulty (i);
        }
    }