Inheritance: MonoBehaviour
Beispiel #1
0
 void Start()
 {
     //魔法管理
     magicMaster  = FindObjectOfType <MagicMaster>();
     targetCursor = FindObjectOfType <TargetCursor>();
     camera       = FindObjectOfType <FollowCamera>();
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     backButton = GameObject.Find("BackButton").GetComponent <Button>();
     backButton.onClick.AddListener(ToggleSkillMenu);
     cancelButton = GameObject.Find("CancelButton").GetComponent <Button> ();
     cancelButton.onClick.AddListener(CancelAction);
     //skillButton = GameObject.FindGameObjectsWithTag ("Skill");
     skillButton     = new GameObject[6];
     skillButton [0] = GameObject.Find("Skill1Button");
     skillButton [1] = GameObject.Find("Skill2Button");
     skillButton [2] = GameObject.Find("Skill3Button");
     skillButton [3] = GameObject.Find("Skill4Button");
     skillButton [4] = GameObject.Find("Skill5Button");
     skillButton [5] = GameObject.Find("Skill6Button");
     skillMenu       = GameObject.Find("SkillButton").GetComponent <Button>();
     skillMenu.onClick.AddListener(ToggleSkillMenu);
     pageNextButton = GameObject.Find("PageNextButton").GetComponent <Button> ();
     //pageNextButton.onClick.AddListener (()=>ToggleVisibleSkills (1));
     pageBackButton = GameObject.Find("PageBackButton").GetComponent <Button> ();
     //pageBackButton.onClick.AddListener (()=>ToggleVisibleSkills (2));
     phasePanel        = GameObject.Find("PhasePanel").GetComponentInChildren <Image> ();
     phaseText         = GameObject.Find("PhasePanel").GetComponentInChildren <Text> ();
     actionPanel       = GameObject.Find("ActionPanel").GetComponent <Image>();
     actionText        = GameObject.Find("ActionPanel").GetComponentInChildren <Text>();
     actionButtons     = new ButtonsUI[skillButton.Length + 2];
     actionButtons [0] = GameObject.Find("ThrowButton").GetComponent <ButtonsUI> ();
     actionButtons [1] = GameObject.Find("CatchButton").GetComponent <ButtonsUI> ();
     for (int i = 0; i < skillButton.Length; i++)
     {
         actionButtons [i + 2] = skillButton [i].GetComponent <ButtonsUI> ();
     }
     openMenu = 0;
     tCursors = GameObject.Find("TargetCursors").GetComponent <TargetCursor> ();
     CM       = GameObject.Find("CombatManager").GetComponent <CombatManager> ();
 }
Beispiel #3
0
    void Start()
    {
        this.gameRuleCtrl   = FindObjectOfType <GameRuleCtrl>();
        this.status         = this.GetComponent <CharacterStatus>();
        this.charaAnimation = this.GetComponent <CharaAnimation>();
        this.inputManager   = FindObjectOfType <InputManager>();
        this.targetCursor   = FindObjectOfType <TargetCursor>();
        this.targetCursor.SetPosition(this.transform.position);

        this.deathSeAudio      = this.gameObject.AddComponent <AudioSource>();
        this.deathSeAudio.clip = this.deathSeClip;
        this.deathSeAudio.loop = false;

        // Assert
        if (this.gameRuleCtrl == null)
        {
            Debug.LogError("Not found 'GameRuleCtrl' object.");
        }
        if (this.status == null)
        {
            Debug.LogError("Not found 'CharacterStatus' component.");
        }
        if (this.charaAnimation == null)
        {
            Debug.LogError("Not found 'CharaAnimation' component.");
        }
        if (this.inputManager == null)
        {
            Debug.LogError("Not found 'InputManager' object.");
        }
    }
Beispiel #4
0
    public GameObject lastBeatEffect;    //ラストビートのえふぇくと

    void Start()
    {
        status         = this.GetComponent <CharacterStatus>();
        charaAnimation = this.GetComponent <CharaAnimation>();
        inputManager   = FindObjectOfType <InputManager>();
        gameRuleCtrl   = FindObjectOfType <GameRuleCtrl>();
        camera         = FindObjectOfType <FollowCamera>();
        //ターゲットマーカー
        targetCursor = FindObjectOfType <TargetCursor>();
        targetCursor.SetPosition(transform.position);

        //ジョイスティック
        joystick = FindObjectOfType <Joystick>();

        damageSeAudio          = gameObject.AddComponent <AudioSource>();
        damageSeAudio.clip     = damageSeClip;
        damageSeAudio.loop     = false;
        damageSeAudio.volume   = 0.2f;
        magicSeAudio           = gameObject.AddComponent <AudioSource>();
        magicSeAudio.clip      = magicSeClip;
        magicSeAudio.loop      = false;
        magicSeAudio.volume    = 0.2f;
        abilitySeAudio         = gameObject.AddComponent <AudioSource>();
        abilitySeAudio.clip    = abilitySeClip;
        abilitySeAudio.loop    = false;
        abilitySeAudio.volume  = 0.2f;
        ability2SeAudio        = gameObject.AddComponent <AudioSource>();
        ability2SeAudio.clip   = abilitySeClip;
        ability2SeAudio.loop   = false;
        ability2SeAudio.volume = 0.2f;

        ReactLine = status.MaxHP * ReactLine;
    }
Beispiel #5
0
    State nextState = State.Walking;    // 다음 스테이트.


    // Use this for initialization
    void Start()
    {
        status         = GetComponent <CharacterStatus>();
        charaAnimation = GetComponent <CharaAnimation>();
        inputManager   = FindObjectOfType <InputManager>();
        gameRuleCtrl   = FindObjectOfType <GameRuleCtrl>();
        targetCursor   = FindObjectOfType <TargetCursor>();
        targetCursor.SetPosition(transform.position);
    }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     defaultColor = gameObject.GetComponent <Image> ().color;
     gameObject.GetComponent <Button> ().onClick.AddListener(ActionSelect);
     this.GetComponent <Image>().alphaHitTestMinimumThreshold = AlphaThreshold;
     actionDescription = GameObject.Find("ActionPanel").GetComponentInChildren <Text>();
     menuOpen          = false;
     tCursor           = GameObject.Find("TargetCursors").GetComponent <TargetCursor> ();
     CM = GameObject.Find("CombatManager").GetComponent <CombatManager> ();
 }
    private void Awake()
    {
        target      = GameObject.Find("Target");
        targetImage = target.GetComponent <Image>();
        cursor      = target.GetComponent <TargetCursor>();

        enemyList = new List <GameObject>();

        enemyList.Add(GameObject.Find("Enemy1"));
        enemyList.Add(GameObject.Find("Enemy2"));
        enemyList.Add(GameObject.Find("Enemy3"));
    }
Beispiel #8
0
    // Use this for initialization
    void Start()
    {
        status         = GetComponent <CharacterStatus>();
        charaAnimation = GetComponent <CharaAnimation>();
        inputManager   = FindObjectOfType <InputManager>();
        gameRuleCtrl   = FindObjectOfType <GameRuleCtrl>();
        targetCursor   = FindObjectOfType <TargetCursor>();
        targetCursor.SetPosition(transform.position);

        // 오디오 초기화.
        deathSeAudio      = gameObject.AddComponent <AudioSource>();
        deathSeAudio.loop = false;
        deathSeAudio.clip = deathSeClip;
    }
Beispiel #9
0
 // Use this for initialization
 void Start()
 {
     status = GetComponent<CharacterStatus>();
     charaAnimation = GetComponent<CharaAnimation>();
     inputManager = FindObjectOfType<InputManager>();
     gameRuleCtrl = FindObjectOfType<GameRuleCtrl>();
     targetCursor = FindObjectOfType<TargetCursor>();
     targetCursor.SetPosition(transform.position);
 }
Beispiel #10
0
    // Use this for initialization
    void Start()
    {
        status = GetComponent<CharacterStatus>();
        charaAnimation = GetComponent<CharaAnimation>();
        inputManager = FindObjectOfType<InputManager>();
        gameRuleCtrl = FindObjectOfType<GameRuleCtrl>();
        targetCursor = FindObjectOfType<TargetCursor>();
        targetCursor.SetPosition(transform.position);

        // 오디오 초기화.
        deathSeAudio = gameObject.AddComponent<AudioSource>();
        deathSeAudio.loop = false;
        deathSeAudio.clip = deathSeClip;
    }
Beispiel #11
0
    void Start()
    {
        combatQueue = new Character[6];

        CUI     = GameObject.Find("CombatUI").GetComponent <CombatUI> ();
        tCursor = GameObject.Find("TargetCursors").GetComponent <TargetCursor> ();
        GameObject[] CharUI  = new GameObject[3];
        GameObject[] EnemyUI = new GameObject[3];
        Player       = new Character[3];
        Enemy        = new Character[3];
        playerSelect = new Button [3];
        enemySelect  = new Button [3];

        // his block sets up the the characters and character select buttons
        for (int i = 0; i < 3; i++)
        {
            // set up the Character select buttons
            CharacterSelectUI PlayerSUI = GameObject.Find("Player" + i).GetComponent <CharacterSelectUI> ();
            CharacterSelectUI EnemySUI  = GameObject.Find("Enemy" + i).GetComponent <CharacterSelectUI> ();
            PlayerSUI.Init(this);
            EnemySUI.Init(this);

            // Set up the players
            Player[i] = GameObject.Find("Character" + i).GetComponent <Character>();
            Enemy [i] = GameObject.Find("Character" + (i + 3)).GetComponent <Character> ();
            Player [i].Init(this, PlayerSUI);
            Enemy [i].Init(this, EnemySUI);

            playerSelect [i] = GameObject.Find("Player" + i).GetComponent <Button> ();
            enemySelect [i]  = GameObject.Find("Enemy" + i).GetComponent <Button> ();

            // Set up each character's UI
            CharUI [i] = GameObject.Find("CharacterUI" + i);
            CharUI [i].GetComponent <CharacterUI> ().Init(Player [i]);
            EnemyUI [i] = GameObject.Find("CharacterUI" + (i + 3));
            EnemyUI [i].GetComponent <CharacterUI> ().Init(Enemy [i]);

            // Set the character's positions to the buttons
            Player[i].transform.position = new Vector3(playerSelect [i].transform.position.x, playerSelect [i].transform.position.y, 98);
            Enemy [i].transform.position = new Vector3(enemySelect [i].transform.position.x, enemySelect [i].transform.position.y, 98);
        }
        // Get the action buttons and set them up
        Button[] action = new Button[5];
        action [0] = GameObject.Find("ThrowButton").GetComponent <Button> ();
        action [1] = GameObject.Find("CatchButton").GetComponent <Button> ();
        action [2] = GameObject.Find("Skill1Button").GetComponent <Button> ();
        action [3] = GameObject.Find("Skill2Button").GetComponent <Button> ();
        action [4] = GameObject.Find("Skill3Button").GetComponent <Button> ();
        for (int i = 0; i < action.Length; i++)
        {
            action [i].GetComponent <ButtonsUI> ().CM = this;
        }

        // Get text components and the end buttons
        combatAction = GameObject.Find("CombatAction").GetComponent <Text> ();
        combatLog    = GameObject.Find("CombatLog").GetComponentInChildren <CombatLog> ();
        //ballsCaught = new System.Collections.Generic.List<bool>();

        // This sets up the character's healthbars and sets their allies and enemies internally
        for (int i = 0; i < 3; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                Player [i].allies [j]  = Player [j];
                Player [i].enemies [j] = Enemy [j];
                Enemy [i].allies [j]   = Enemy [j];
                Enemy [i].enemies [j]  = Player [j];
            }
        }
        AI = gameObject.GetComponentInChildren <EnemyAI> ();
    }
        /// <summary>
        /// Compares the character data stored in two different strings based on the
        /// collation rules.  Returns information about whether a string is less
        /// than, greater than or equal to another string in a language.
        /// This can be overriden in a subclass.
        /// </summary>
        /// <exception cref="NullPointerException"> if <code>source</code> or <code>target</code> is null. </exception>
        public override int Compare(String source, String target)
        {
            lock (this)
            {
                if (source == null || target == null)
                {
                    throw new NullPointerException();
                }

                // The basic algorithm here is that we use CollationElementIterators
                // to step through both the source and target strings.  We compare each
                // collation element in the source string against the corresponding one
                // in the target, checking for differences.
                //
                // If a difference is found, we set <result> to LESS or GREATER to
                // indicate whether the source string is less or greater than the target.
                //
                // However, it's not that simple.  If we find a tertiary difference
                // (e.g. 'A' vs. 'a') near the beginning of a string, it can be
                // overridden by a primary difference (e.g. "A" vs. "B") later in
                // the string.  For example, "AA" < "aB", even though 'A' > 'a'.
                //
                // To keep track of this, we use strengthResult to keep track of the
                // strength of the most significant difference that has been found
                // so far.  When we find a difference whose strength is greater than
                // strengthResult, it overrides the last difference (if any) that
                // was found.

                int result = Collator.EQUAL;

                if (SourceCursor == null)
                {
                    SourceCursor = GetCollationElementIterator(source);
                }
                else
                {
                    SourceCursor.Text = source;
                }
                if (TargetCursor == null)
                {
                    TargetCursor = GetCollationElementIterator(target);
                }
                else
                {
                    TargetCursor.Text = target;
                }

                int sOrder = 0, tOrder = 0;

                bool initialCheckSecTer = Strength >= Collator.SECONDARY;
                bool checkSecTer        = initialCheckSecTer;
                bool checkTertiary      = Strength >= Collator.TERTIARY;

                bool gets = true, gett = true;

                while (true)
                {
                    // Get the next collation element in each of the strings, unless
                    // we've been requested to skip it.
                    if (gets)
                    {
                        sOrder = SourceCursor.Next();
                    }
                    else
                    {
                        gets = true;
                    }
                    if (gett)
                    {
                        tOrder = TargetCursor.Next();
                    }
                    else
                    {
                        gett = true;
                    }

                    // If we've hit the end of one of the strings, jump out of the loop
                    if ((sOrder == CollationElementIterator.NULLORDER) || (tOrder == CollationElementIterator.NULLORDER))
                    {
                        break;
                    }

                    int pSOrder = CollationElementIterator.PrimaryOrder(sOrder);
                    int pTOrder = CollationElementIterator.PrimaryOrder(tOrder);

                    // If there's no difference at this position, we can skip it
                    if (sOrder == tOrder)
                    {
                        if (Tables_Renamed.FrenchSec && pSOrder != 0)
                        {
                            if (!checkSecTer)
                            {
                                // in french, a secondary difference more to the right is stronger,
                                // so accents have to be checked with each base element
                                checkSecTer = initialCheckSecTer;
                                // but tertiary differences are less important than the first
                                // secondary difference, so checking tertiary remains disabled
                                checkTertiary = false;
                            }
                        }
                        continue;
                    }

                    // Compare primary differences first.
                    if (pSOrder != pTOrder)
                    {
                        if (sOrder == 0)
                        {
                            // The entire source element is ignorable.
                            // Skip to the next source element, but don't fetch another target element.
                            gett = false;
                            continue;
                        }
                        if (tOrder == 0)
                        {
                            gets = false;
                            continue;
                        }

                        // The source and target elements aren't ignorable, but it's still possible
                        // for the primary component of one of the elements to be ignorable....

                        if (pSOrder == 0)                         // primary order in source is ignorable
                        {
                            // The source's primary is ignorable, but the target's isn't.  We treat ignorables
                            // as a secondary difference, so remember that we found one.
                            if (checkSecTer)
                            {
                                result      = Collator.GREATER;                            // (strength is SECONDARY)
                                checkSecTer = false;
                            }
                            // Skip to the next source element, but don't fetch another target element.
                            gett = false;
                        }
                        else if (pTOrder == 0)
                        {
                            // record differences - see the comment above.
                            if (checkSecTer)
                            {
                                result      = Collator.LESS;                            // (strength is SECONDARY)
                                checkSecTer = false;
                            }
                            // Skip to the next source element, but don't fetch another target element.
                            gets = false;
                        }
                        else
                        {
                            // Neither of the orders is ignorable, and we already know that the primary
                            // orders are different because of the (pSOrder != pTOrder) test above.
                            // Record the difference and stop the comparison.
                            if (pSOrder < pTOrder)
                            {
                                return(Collator.LESS);                                // (strength is PRIMARY)
                            }
                            else
                            {
                                return(Collator.GREATER);                                // (strength is PRIMARY)
                            }
                        }
                    }                     // else of if ( pSOrder != pTOrder )
                    else
                    {
                        // primary order is the same, but complete order is different. So there
                        // are no base elements at this point, only ignorables (Since the strings are
                        // normalized)

                        if (checkSecTer)
                        {
                            // a secondary or tertiary difference may still matter
                            short secSOrder = CollationElementIterator.SecondaryOrder(sOrder);
                            short secTOrder = CollationElementIterator.SecondaryOrder(tOrder);
                            if (secSOrder != secTOrder)
                            {
                                // there is a secondary difference
                                result = (secSOrder < secTOrder) ? Collator.LESS : Collator.GREATER;
                                // (strength is SECONDARY)
                                checkSecTer = false;
                                // (even in french, only the first secondary difference within
                                //  a base character matters)
                            }
                            else
                            {
                                if (checkTertiary)
                                {
                                    // a tertiary difference may still matter
                                    short terSOrder = CollationElementIterator.TertiaryOrder(sOrder);
                                    short terTOrder = CollationElementIterator.TertiaryOrder(tOrder);
                                    if (terSOrder != terTOrder)
                                    {
                                        // there is a tertiary difference
                                        result = (terSOrder < terTOrder) ? Collator.LESS : Collator.GREATER;
                                        // (strength is TERTIARY)
                                        checkTertiary = false;
                                    }
                                }
                            }
                        }         // if (checkSecTer)
                    }             // if ( pSOrder != pTOrder )
                }                 // while()

                if (sOrder != CollationElementIterator.NULLORDER)
                {
                    // (tOrder must be CollationElementIterator::NULLORDER,
                    //  since this point is only reached when sOrder or tOrder is NULLORDER.)
                    // The source string has more elements, but the target string hasn't.
                    do
                    {
                        if (CollationElementIterator.PrimaryOrder(sOrder) != 0)
                        {
                            // We found an additional non-ignorable base character in the source string.
                            // This is a primary difference, so the source is greater
                            return(Collator.GREATER);                            // (strength is PRIMARY)
                        }
                        else if (CollationElementIterator.SecondaryOrder(sOrder) != 0)
                        {
                            // Additional secondary elements mean the source string is greater
                            if (checkSecTer)
                            {
                                result      = Collator.GREATER;                            // (strength is SECONDARY)
                                checkSecTer = false;
                            }
                        }
                    } while ((sOrder = SourceCursor.Next()) != CollationElementIterator.NULLORDER);
                }
                else if (tOrder != CollationElementIterator.NULLORDER)
                {
                    // The target string has more elements, but the source string hasn't.
                    do
                    {
                        if (CollationElementIterator.PrimaryOrder(tOrder) != 0)
                        // We found an additional non-ignorable base character in the target string.
                        // This is a primary difference, so the source is less
                        {
                            return(Collator.LESS);                            // (strength is PRIMARY)
                        }
                        else if (CollationElementIterator.SecondaryOrder(tOrder) != 0)
                        {
                            // Additional secondary elements in the target mean the source string is less
                            if (checkSecTer)
                            {
                                result      = Collator.LESS;                            // (strength is SECONDARY)
                                checkSecTer = false;
                            }
                        }
                    } while ((tOrder = TargetCursor.Next()) != CollationElementIterator.NULLORDER);
                }

                // For IDENTICAL comparisons, we use a bitwise character comparison
                // as a tiebreaker if all else is equal
                if (result == 0 && Strength == IDENTICAL)
                {
                    int             mode = Decomposition;
                    Normalizer.Form form;
                    if (mode == CANONICAL_DECOMPOSITION)
                    {
                        form = Normalizer.Form.NFD;
                    }
                    else if (mode == FULL_DECOMPOSITION)
                    {
                        form = Normalizer.Form.NFKD;
                    }
                    else
                    {
                        return(source.CompareTo(target));
                    }

                    String sourceDecomposition = Normalizer.Normalize(source, form);
                    String targetDecomposition = Normalizer.Normalize(target, form);
                    return(sourceDecomposition.CompareTo(targetDecomposition));
                }
                return(result);
            }
        }
Beispiel #13
0
 void Start()
 {
     inputManager = FindObjectOfType <InputManager>();
     target       = targetCursor.GetComponent <TargetCursor>();
 }
Beispiel #14
0
 private void Awake()
 {
     instance = this;
 }