Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     logPanel = GameObject.Find("LogPanel");
     ls       = logPanel.GetComponent <LogScript> ();
     stage    = GameObject.Find("Stage");
     ss       = stage.GetComponent <StageScript> ();
 }
Ejemplo n.º 2
0
    void Start()
    {
        Player = GameObject.FindWithTag("Player");
        Player.GetComponent <SpriteRenderer>().sortingOrder = 10;
        Hander      = Resources.Load <Image>("handImage");
        StoryCanvas = GameObject.Find("StoryCanvas");

        OptionBG = Instantiate(Resources.Load <GameObject>("OptionBG"));

        var   bg = OptionBG.GetComponent <SpriteRenderer>();
        float worldScreenHeight = Camera.main.orthographicSize * 2f;
        float worldScreenWight  = worldScreenHeight / Screen.height * Screen.width;
        float width             = bg.sprite.bounds.size.x;
        float height            = bg.sprite.bounds.size.y;

        OptionBG.transform.localScale = new Vector3(worldScreenWight / width, worldScreenHeight / height);
        Vector3 camPos = Camera.main.transform.position;

        camPos.z = 0;
        OptionBG.transform.position = camPos;

        OptionBG.GetComponent <SpriteRenderer>().sortingOrder = 8;
        PointHand = Instantiate(Resources.Load <GameObject>("hand"));

        OldMa = Resources.Load <GameObject>("OldMa");
        dango = Resources.Load <GameObject>("dango2");
        stage = GameObject.FindWithTag("GameController").GetComponent <StageScript>();
    }
Ejemplo n.º 3
0
 void Start()
 {
     Player      = GameObject.FindWithTag("Player");
     Hander      = Resources.Load <Image>("handImage");
     StoryCanvas = GameObject.Find("StoryCanvas");
     stage       = GameObject.FindWithTag("GameController").GetComponent <StageScript>();
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     stage             = GameObject.Find("Stage");
     ss                = stage.GetComponent <StageScript> ();
     animTurnText      = GetComponent <Text>();
     animTurnText.text = "";
 }
Ejemplo n.º 5
0
    public IEnumerator ExitAndEnter()
    {
        Systems        = GameObject.Find("Systems");
        stageScript    = Systems.GetComponent <StageScript>();
        Audio          = GetComponent <AudioSource>();
        Time.timeScale = 0;
        if (EnteringSound != null)
        {
                                   //侵入時の音
            {
                Audio.clip = EnteringSound;
                Audio.Play();
            }
        }
        yield return(StartCoroutine(WaitFadeIn(0.1f, 0.5f)));

        if (NextUp != null) //次ステージ形成。
        {
            stageScript.nextComp  = NextUp;
            stageScript.TransitTo = TransitTo;
            stageScript.DestroyCurrentMap();
            stageScript.InstantiateNextMap();
            Time.timeScale = 1;
        }
        yield return(StartCoroutine(WaitFadeOut(1f, 0.5f)));

        yield return(null);
    }
Ejemplo n.º 6
0
    public void moveToSlot(int c, int r, bool earlyCreation = false)
    {
        int  previousCol = colPos;
        int  previousRow = rowPos;
        bool slotEmpty   = false;

        if (StageScript.isSlotEmpty(c, r))
        {
            slotEmpty = true;
            StageScript.addCharacterToSlot(c, r, heroType);

            if (colPos >= 0 && rowPos >= 0)
            {
                StageScript.emptySlot(colPos, rowPos);
            }

            colPos = c; rowPos = r;
        }

        if (colPos < 0 || rowPos < 0)
        {
            buildBench.GetComponent <BuildManagerScript>().updatePositions();
        }
        else
        {
            transform.position = new Vector2(StageScript.cols [colPos], StageScript.rows [rowPos]);
            if (slotEmpty)
            {
                didMoveToSlot(c, r, previousCol, previousRow, earlyCreation);
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     stage     = GameObject.Find("Stage");
     ss        = stage.GetComponent <StageScript> ();
     resources = GameObject.Find("Resources");
     rm        = resources.GetComponent <ResourcesManager> ();
 }
Ejemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        m_StageScript = GetComponentInParent <StageScript>();
        m_GameManager = GameObject.FindGameObjectWithTag("GameManager");

        m_ShownBefore = false;
    }
    void Start()
    {
        DeathFlag       = true;
        audioSource     = gameObject.AddComponent <AudioSource>();
        TapEffect       = Resources.Load <GameObject>("TapEffect");
        worldPos        = transform.position;
        PlayersStrength = GameObject.Find("GameMaster").GetComponent <StageScript>();
        trs             = GetComponent <Transform>();
        Under           = -1.3f;
        Over            = 3.5f;
        RightEnd        = 8.62f;
        LeftEnd         = -8.62f;

        SwordPrefab          = (GameObject)Resources.Load("SwordAttack");
        SwordSPr             = SwordPrefab.GetComponent <SwordScript>();
        SwordSPr.MoveSpeed   = AttackSpeed;
        SwordSPr.AttackPower = AttackPower;

        offset = new Vector3(-0.5f, 0);
        if (PlayerPrefs.HasKey("SE"))
        {
            maxVolume = PlayerPrefs.GetFloat("SE") * 0.5f;
        }
        audioSource.volume = maxVolume;
    }
Ejemplo n.º 10
0
    void Start()
    {
        StageScript stageScript = GetComponent <StageScript>();

        stageScript.stageIconSpritePath = "res/image/stg2";
        stageScript.explanationText     = "普通すぎるステージ。KOH。";
        stageScript.stageName           = "ステージ2";
    }
Ejemplo n.º 11
0
    void Start()
    {
        StageScript stageScript = GetComponent <StageScript>();

        stageScript.stageIconSpritePath = "res/image/stg1";
        stageScript.explanationText     = "簡単すぎるステージ。くそざこ。";
        stageScript.stageName           = "ステージ1";
    }
Ejemplo n.º 12
0
    void Start()
    {
        StageScript stageScript = GetComponent <StageScript>();

        stageScript.stageIconSpritePath = "res/image/stg3";
        stageScript.explanationText     = "難しすぎるステージ。マジ無理ゲー。";
        stageScript.stageName           = "ステージ3";
    }
Ejemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        GameObject stageScriptGameObject = GameObject.FindGameObjectWithTag("StageScript");

        if (stageScriptGameObject != null)
        {
            _stageScript = stageScriptGameObject.GetComponent <StageScript> ();
        }
    }
    // Use this for initialization
    void Start()
    {
        Log = transform.Find("LogText").GetComponent <Text> ();


        Log.color = new Color(1, 1, 1, 1);

        stage = GameObject.Find("Stage");
        ss    = stage.GetComponent <StageScript> ();
    }
Ejemplo n.º 15
0
 public static void clearAllPower()
 {
     for (uint c = 0; c < StageScript.cols.Length; ++c)
     {
         for (uint r = 0; r < StageScript.rows.Length; ++r)
         {
             powerSlots[c, r].Clear();
             StageScript.colorTile(HeroType.NONE, c, r);
         }
     }
 }
Ejemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        if (script.setStage != null)
        {
            GameObject stageObj = GameObject.Find(script.setStage);
            stageText = stageObj.GetComponent <StageScript>();

            Text myText = GetComponent <Text>();
            myText.text = stageText.explanationText;
        }
    }
Ejemplo n.º 17
0
    public void SetListScene(int x)
    {
        title.SetActive(false);
        mainMenu.SetActive(false);
        rightButton.SetActive(false);
        leftButton.SetActive(false);

        StageScript.SetStage();
        StoryScript.SetStory();
        StartCoroutine(MoveCamera(new Vector2(x, 0)));
    }
Ejemplo n.º 18
0
    private void AddStage(int i, int j)
    {
        float nOffsetX;
        float nOffsetY;

        //  Stageの作成
        GameObject stageObj = Instantiate(stageprefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity);

        StageScript ss = stageObj.GetComponent <StageScript>();

        ss.AddBuildings(i, j);
    }
Ejemplo n.º 19
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.gameObject.name == "Player")
        {
            StageScript stage = GameObject.Find("Systems").GetComponent <StageScript>();

            collision.transform.position =
                new Vector2((stage.TransitTo.x - stage.MapLength / 2f) * stage.baseSprite.bounds.size.x,
                            ((stage.MapHeight / 2f) - stage.TransitTo.y) * stage.baseSprite.bounds.size.y);
            Debug.Log(collision.transform.position.ToString());
            Debug.Log("Dead!");
        }
    }
Ejemplo n.º 20
0
    public override void _Ready()
    {
        if (!Engine.EditorHint)
        {
            GetNode <Label>("NameLabel").QueueFree();
        }

        if (HasNode("Machine"))
        {
            Machine = GetNode <Home>("Machine");
        }

        playerSpawn = GetNode <Position2D>("PlayerSpawn");

        Node2D spawnersNode = GetNode <Node2D>("Spawners");

        spawners = new Spawner[spawnersNode.GetChildCount()];
        for (int i = 0; i < spawners.Length; i++)
        {
            RayCast2D ray = spawnersNode.GetChild <RayCast2D>(i);
            spawners[i].FacingDir = (int)ray.Scale.x;
            spawners[i].Position  = ray.GlobalPosition;
        }

        Node2D dropPlacesNode = GetNode <Node2D>("DropPlaces");

        dropPlaces = new Vector2[dropPlacesNode.GetChildCount()];
        for (int i = 0; i < dropPlaces.Length; i++)
        {
            Position2D dropPlace = dropPlacesNode.GetChild <Position2D>(i);
            dropPlaces[i] = dropPlace.GlobalPosition;
        }

        Node2D doorsNode = GetNode <Node2D>("Doors");

        doors = new Door[doorsNode.GetChildCount()];
        for (int i = 0; i < doors.Length; i++)
        {
            doors[i] = doorsNode.GetChild <Door>(i);
        }

        transitions = GetNode <Node2D>("Transitions");

        if (!HasNode("ScriptSequence"))
        {
            return;
        }

        stageScript = GetNode <StageScript>("ScriptSequence");
        stageScript.BuildFor(this);
    }
    // Use this for initialization
    void Start()
    {
        resources = GameObject.Find("Resources");
        rm        = resources.GetComponent <ResourcesManager> ();
        turns     = GameObject.Find("Turns");
        ts        = turns.GetComponent <TurnsScript> ();
        //earthPanel = GameObject.Find ("EarthPanel");
        //es = earthPanel.GetComponent<ElementScript> ();
        logPanel = GameObject.Find("LogPanel");
        ls       = logPanel.GetComponent <LogScript> ();
        stage    = GameObject.Find("Stage");
        ss       = stage.GetComponent <StageScript> ();

        buildingSelection = -1;
    }
Ejemplo n.º 22
0
    public static void removePower(HeroType type, uint posX, uint posY)
    {
        powerSlots [posX, posY].Remove(type);

        int count = powerSlots [posX, posY].Count;

        if (count == 0)
        {
            StageScript.colorTile(HeroType.NONE, posX, posY);
        }
        else
        {
            StageScript.colorTile(powerSlots [posX, posY][count - 1], posX, posY);
        }
    }
    // Use this for initialization
    void Start()
    {
        popP1Text   = transform.Find("popP1").GetComponent <Text>();
        moneyP1Text = transform.Find("moneyP1").GetComponent <Text>();
        popP2Text   = transform.Find("popP2").GetComponent <Text>();
        moneyP2Text = transform.Find("moneyP2").GetComponent <Text>();

        stage = GameObject.Find("Stage");
        ss    = stage.GetComponent <StageScript> ();

        popP1Text.color   = new Color(0, 0, 1, 1);
        moneyP1Text.color = new Color(0, 0, 1, 1);
        popP2Text.color   = new Color(1, 0, 0, 1);
        moneyP2Text.color = new Color(1, 0, 0, 1);
    }
Ejemplo n.º 24
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(instance);
        }

        currentNbrStage           = PlayerPrefs.GetInt("currentNbrStage", currentNbrStage);
        ProjectHolder.OnTaskDone += HandleTaskDone;
        ChangeBackgroundImage();
        RefreshText();
    }
Ejemplo n.º 25
0
    // board management

    override protected void removeFromBoard()
    {
        bool removeImmediately = willRemoveFromBoard();

        StageScript.emptySlot(colPos, rowPos);

        if (dieSound)
        {
            dieSound.Play();
        }

        if (removeImmediately)
        {
            base.removeFromBoard();
        }
    }
    // Use this for initialization
    void Start()
    {
        stage     = GameObject.Find("Stage");
        ss        = stage.GetComponent <StageScript> ();
        turns     = GameObject.Find("Turns");
        ts        = turns.GetComponent <TurnsScript> ();
        resources = GameObject.Find("Resources");
        rm        = resources.GetComponent <ResourcesManager> ();


        P1ResultLog       = transform.Find("P1Result").GetComponent <Text> ();
        P2ResultLog       = transform.Find("P2Result").GetComponent <Text> ();
        eventLog          = transform.Find("EventLog").GetComponent <Text> ();
        P1ResultLog.color = new Color(0, 0, 1, 1);
        P2ResultLog.color = new Color(1, 0, 0, 1);
        eventLog.color    = new Color(0, 1, 0, 1);
    }
    // Use this for initialization
    void Start()
    {
        resources   = GameObject.Find("Resources");
        rm          = resources.GetComponent <ResourcesManager> ();
        stageScript = GameObject.Find("Stage");
        ss          = stageScript.GetComponent <StageScript> ();
        SPHealthOJ  = GameObject.Find("SpawnPointFab");
        sh          = SPHealthOJ.GetComponent <SpawnPointHealthScript> ();


        gasText     = transform.Find("GasTip").GetComponent <Text>();
        nuclearText = transform.Find("NuclearTip").GetComponent <Text>();
        coalText    = transform.Find("CoalTip").GetComponent <Text>();
        windText    = transform.Find("WindTip").GetComponent <Text>();
        oilText     = transform.Find("OilTip").GetComponent <Text>();
        solarText   = transform.Find("SolarTip").GetComponent <Text>();
    }
Ejemplo n.º 28
0
    void Start()
    {
        GlassDeploy_Barrier = GameObject.Find("GlassDeploy_Barrier");
        GlassDeploy_Barrier.SetActive(false);
        Reset = GameObject.Find("ResetIndicator").transform.Find("Button").gameObject;
        IM    = GameObject.Find("StageInitializer").GetComponent <ItemManager>();

        Debug.Assert(stageRoot != null);
        stage = stageRoot.GetComponent <StageScript> ();
        pos   = stage.GetInitPosition();
        Vector2 initScenepos = stage.ScenePosOf(pos);

        gameObject.transform.localPosition = initScenepos;
        stage.UpdateStage(pos, 1);

        tutorialText = GameObject.Find("Tutorial").GetComponent <Text>();
    }
Ejemplo n.º 29
0
    void Start()
    {
        transform.GetChild(0).gameObject.SetActive(true);
        stage    = GameObject.FindWithTag("GameController").GetComponent <StageScript>();
        moveFlag = false;
        stage.FrendAttackNG();
        switch (type)
        {
        case 1:
            boss = GameObject.Find("Boss_Dog(Clone)");
            break;

        case 2:
            boss = GameObject.Find("Boss_Monkey(Clone)");
            break;

        case 3:
            boss = GameObject.Find("Boss_Bird(Clone)");
            break;

        case 4:
            boss = GameObject.Find("Egreen(Clone)");
            break;

        case 5:
            boss = GameObject.Find("Eblue(Clone)");
            break;

        case 6:
            boss = GameObject.Find("Egray(Clone)");
            break;

        case 7:
            boss = GameObject.Find("Eyellow(Clone)");
            break;

        case 8:
            boss = GameObject.Find("Ered(Clone)");
            break;
        }
    }
Ejemplo n.º 30
0
    private IEnumerator ScriptCommandProcess(StageScript script, UnityAction callback)
    {
        float x     = 0;
        float y     = 0;
        uint  alive = 0;

        switch (script.ScriptCommand)
        {
        case StageScript.SCRIPT_COMMAND.CREATE_ENEMY:
            float.TryParse(script.GetParameterValue(3, 0), out x);
            float.TryParse(script.GetParameterValue(3, 1), out y);
            uint.TryParse(script.GetParameterValue(4), out alive);
            CreateEnemy(script.GetParameterValue(0), script.GetParamter(1), script.GetParamter(2), new Vector2(x, y), alive);
            break;

        case StageScript.SCRIPT_COMMAND.SCROLL_START:
            break;

        case StageScript.SCRIPT_COMMAND.WAIT:
            int waitFrame = 0;
            int.TryParse(script.GetParameterValue(0), out waitFrame);
            yield return(WaitFrame(waitFrame));

            break;

        case StageScript.SCRIPT_COMMAND.CREATE_BOSS:

            float.TryParse(script.GetParameterValue(3, 0), out x);
            float.TryParse(script.GetParameterValue(3, 1), out y);
            uint.TryParse(script.GetParameterValue(4), out alive);
            CreateBoss(script.GetParameterValue(0), script.GetParamter(1), script.GetParamter(2), new Vector2(x, y), alive);
            break;
        }
        this.StageCommandIndex++;
        callback();
    }