Inheritance: MonoBehaviour
コード例 #1
0
ファイル: Switch.cs プロジェクト: Lito0542/sannabi
 private void Start()
 {
     girlController = FindObjectOfType <GirlController>();
     outlined       = GetComponent <Outlined>();
     player         = FindObjectOfType <Player>();
     isUsed         = false;
 }
コード例 #2
0
    // Initialize
    void Awake()
    {
        // singleton
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        // Initialize
        //
        // skill list
        if (skillList == null)
        {
            skillList = new List <Knowledge>();
        }
        // ally list
        if (allyList == null)
        {
            allyList = new List <BattleNPC>();
        }
        // item list
        if (itemList == null)
        {
            itemList = new List <Item>();
        }
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent <Animator> ();
        girl     = FindObjectOfType <GirlController> ();

        isWalking = true;
    }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     if (girlController == null)
     {
         girlController = transform.parent.GetComponentInChildren <GirlController>();
     }
 }
コード例 #5
0
    // check if girl emotion stable
    void CheckUncontrollableAction()
    {
        // cache Girl controller
        GirlController girl = GirlController.Instance;
        // check eq level
        float girlEmotion = girl.GetEmotionLevel();

        // if eq level higher or equal to x
        if (girlEmotion >= GirlController.MAX_EMOTIONLEVEL)
        {
            if (girl.GetEmotionType() == EmotionType.ANGRY)
            {
                myAction[indexOfAction] = new UncontrollableAngry();
            }
            else if (girl.GetEmotionType() == EmotionType.HAPPY)
            {
                myAction[indexOfAction] = new UncontrollableHappy();
            }
            else if (girl.GetEmotionType() == EmotionType.SAD)
            {
                myAction[indexOfAction] = new UncontrollableSad();
            }
            else if (girl.GetEmotionType() == EmotionType.SCARE)
            {
                myAction[indexOfAction] = new UncontrollableScare();
            }

            // disable choose ally and choose action
            currentState = SelectionState.UNCONTROLLABLE;
            // skip to battle phase and disable this script
            GameStateManager.Instance.SetGameState(GameState.BATTLE_PHASE);
            this.enabled = false;
        }
    }
コード例 #6
0
ファイル: GirlEffect.cs プロジェクト: qq282196521/DK
 // Use this for initialization
 void Start()
 {
     if (girlController == null)
     {
         girlController = transform.parent.GetComponentInChildren<GirlController>();
     }
 }
コード例 #7
0
ファイル: GirlBody.cs プロジェクト: qq282196521/DoubleKatana
 void Awake()
 {
     if (m_GirlController == null)
     {
         GameObject Girl = GameObject.FindGameObjectWithTag("Girl");
         if (Girl != null)
         {
             m_GirlController = Girl.GetComponent <GirlController>();
         }
         else
         {
             Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
         }
     }
     if (m_PlayerController == null)
     {
         GameObject player = GameObject.FindGameObjectWithTag("Player");
         if (player != null)
         {
             m_PlayerController = player.GetComponent <PlayerController>();
         }
         else
         {
             Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
         }
     }
 }
コード例 #8
0
    // Use this for initialization
    void Start()
    {
        player      = GameObject.FindGameObjectWithTag("Player");
        playerLives = player.GetComponent <Lifes>();
        playerContr = player.GetComponent <GirlController>();

        Invoke("StopLevel", timeToBoss);
    }
コード例 #9
0
 void Awake()
 {
     Phone      = GameObject.FindWithTag("PhoneMenu");
     conversant = GetComponent <AIConversant>();
     //Loading = GameObject.FindWithTag("GameController").GetComponent<LoadingScreenScript>();
     girlController = GameObject.FindWithTag("GameController").GetComponent <GirlController>();
     girlManager    = GameObject.FindWithTag("GirlContainer").GetComponent <GirlManager>();
 }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        playerLives = player.GetComponent<Lifes>();
        playerContr = player.GetComponent<GirlController>();

        Invoke("StopLevel", timeToBoss);
    }
コード例 #11
0
 private void Awake()
 {
     girl = GirlController.Instance;
     // set this to girl controller
     girl.SetMovementController(this);
     // cache game state manager
     gsm = GameStateManager.Instance;
     // cache rigid body
     rb2d = GetComponent <Rigidbody2D>();
 }
コード例 #12
0
    // Start is called before the first frame update
    void Start()
    {
        int            date;
        GirlController controller = GetComponent <GirlController>();

        date = controller.GetDateLevel();
        if (date > 2)
        {
            AIConversant Conversant = GetComponent <AIConversant>();
            Conversant.SetNewDialog(dialogue);
        }
    }
コード例 #13
0
    private void Awake()
    {
        // cache girl controller
        girl = GirlController.Instance;
        // cache game state manager
        gsm = GameStateManager.Instance;

        // link to girl
        girl.SetBattleEndController(this);

        this.enabled = false;
    }
コード例 #14
0
 private void Awake()
 {
     // cache girl
     girl = GirlController.Instance;
     // initiate sprite renderer
     mySprites = new SpriteRenderer[actionObjects.Length];
     // cache sprite renderer
     for (int i = 0; i < actionObjects.Length; i++)
     {
         mySprites[i] = actionObjects[i].GetComponent <SpriteRenderer>();
     }
 }
コード例 #15
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent <Animator> ();

        lightSwitches = FindObjectsOfType <LampSwitch> ();
        liftSigns     = FindObjectsOfType <LiftSign> ();
        hallElevator  = FindObjectOfType <HallElevator> ();
        camera        = FindObjectOfType <CameraController> ();
        girl          = FindObjectOfType <GirlController> ();

        TurnOnLights(false);
        charger.intensity = 0;
    }
コード例 #16
0
    // knowledge selection
    void SelectKnowledge()
    {
        // clear selected knowledge
        selectedKnowledge = null;
        GirlController girl = GirlController.Instance;

        // activate skill selection objects
        skillSelectionEffectController.ActivateSpriteObjects();

        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            if (knowledgeIndex == 0)
            {
                //  knowledgeIndex = girl.GetSkillList().Count - 1;
                // stop at index 0
                knowledgeIndex = 0;
            }
            else
            {
                knowledgeIndex--;
            }
        }
        else if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            if (knowledgeIndex == girl.GetSkillList().Count - 1)
            {
                // knowledgeIndex = 0;
                // stop at last index
                knowledgeIndex = girl.GetSkillList().Count - 1;
            }
            else
            {
                knowledgeIndex++;
            }
        }

        // pass in knowledge index into skillSelectionEffectController
        skillSelectionEffectController.ChangeSprite(knowledgeIndex);

        // select skill/knowledge
        if (Input.GetKeyDown(KeyCode.Z))
        {
            // Use Knowledge
            myAction[indexOfAction] = new UseKnowledge(selectedAlly, selectedKnowledge);

            selectedKnowledge = girl.GetSkillList()[knowledgeIndex];
            skillSelectionEffectController.DeactivateSpriteObjects();

            currentState = SelectionState.TARGET;
        }
    }
コード例 #17
0
ファイル: GameStateManager.cs プロジェクト: FJinn/The_Girl
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        cam = Camera.main;
        // cache girl controller
        girl = GirlController.Instance;
    }
コード例 #18
0
        private void Start()
        {
            // Get spawned girl obect
            GameObject girlContainer = GameObject.FindWithTag("GirlContainer");

            if (girlContainer.transform.childCount == 0)
            {
                return;
            }

            GameObject charPrefab = girlContainer.transform.GetChild(0).gameObject;

            girlInflation  = charPrefab.GetComponent <GirlInflation>();
            girlController = charPrefab.GetComponent <GirlController>();
        }
コード例 #19
0
 private void Awake()
 {
     // get girl controller
     girl = GirlController.Instance;
     // initialize the slot content
     myKnowledge = new Knowledge(myID, myName, myDescription, myElement, myType, myValue, mySprite);
     // link sprite to img
     myImage        = gameObject.GetComponent <Image>();
     myImage.sprite = mySprite;
     // add to knowledgeSlotInterface list
     // assuming it will auto update when this script value is changed
     // for saving the data, telling data which has activated
     // awake initialize got problem, set to manual drag to list for now
     // girl.GetKnowledgeSlotInterface().AddToList(myID, this);
 }
コード例 #20
0
    /// <summary>
    /// initialize object variance
    /// </summary>
    void Start()
    {
        dataController = FindObjectOfType <DataController>();

        correct = GetComponent <AudioSource>();

        currentRoundData = dataController.GetCurrentRoundData();
        questionPool     = currentRoundData.questions;

        characterHealth     = FindObjectOfType <CharacterHealth>();
        characterController = FindObjectOfType <CharacterController>();
        girlHealth          = FindObjectOfType <GirlHealth>();
        girlController      = FindObjectOfType <GirlController>();

        //ShowQuestion();
    }
コード例 #21
0
 private void Awake()
 {
     // cache girl
     girl = GirlController.Instance;
     // initiate sprite renderer
     skillSprites = new SpriteRenderer[skillObjects.Length];
     // calculate mid point
     midPoint = skillObjects.Length / 2;
     // cache sprite renderer
     for (int i = 0; i < skillObjects.Length; i++)
     {
         skillSprites[i] = skillObjects[i].GetComponent <SpriteRenderer>();
     }
     // cache girl skill list
     skills = girl.GetSkillList();
 }
コード例 #22
0
ファイル: GirlBody.cs プロジェクト: qq282196521/DK
	void Awake () {
        if (m_GirlController == null)
        {
            GameObject Girl = GameObject.FindGameObjectWithTag("Girl");
            if (Girl != null)
            {
                m_GirlController = Girl.GetComponent<GirlController>();
            }
            else Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
        }
        if (m_PlayerController == null)
        {
            GameObject player = GameObject.FindGameObjectWithTag("Player");
            if (player != null)
            {
                m_PlayerController = player.GetComponent<PlayerController>();
            }
            else Debug.Log("GameObject(Player) not found in HitInspector.cs:start()!");
        }
	}
コード例 #23
0
ファイル: CharmContainer.cs プロジェクト: Lito0542/sannabi
    public void UseCharm(Transform target)
    {
        current_amount++;
        GirlController girlController = GetComponent <GirlController>();

        girlController.ChangeState(GirlState.Wait);
        if (current_amount > max_amount)
        {
            Charm delete_charm = charmList[0];
            charmList.RemoveAt(0);
            delete_charm.DeleteCharm();
            current_amount--;
        }
        Charm newCharm = Instantiate(charm, target.position, Quaternion.identity, target.transform);

        newCharm.c_obj = target.gameObject.GetComponent <CharmableObject>();
        charmList.Add(newCharm);
        newCharm.CharmEffect();
        girlController.ChangeTarget();
        girlController.ChangeState(GirlState.Follow);
    }
コード例 #24
0
 private void Awake()
 {
     girl = GirlController.Instance;
 }
コード例 #25
0
ファイル: BaseAction.cs プロジェクト: rdshack/CProto
 public virtual void Start()
 {
     gc = GetComponent<GirlController>();
     animator = GetComponentInChildren<Animator>();
 }
コード例 #26
0
 private void Awake()
 {
     conversant     = GetComponent <AIConversant>();
     girlController = GetComponent <GirlController>();
 }
コード例 #27
0
 private void Awake()
 {
     girl = GirlController.Instance;
     girl.SetBattlePhaseController(this);
 }
コード例 #28
0
 private void Awake()
 {
     conversant     = GetComponent <AIConversant>();
     girlController = GetComponent <GirlController>();
     musicSource    = GameObject.FindWithTag("MainCamera").GetComponent <AudioSource>();
 }
コード例 #29
0
ファイル: GirlAnimationEvents.cs プロジェクト: rdshack/CProto
 // Use this for initialization
 void Awake()
 {
     controller = transform.parent.GetComponent<BaseController>();
     combo = transform.parent.GetComponent<Combo>();
     gc = transform.parent.GetComponent<GirlController>();
 }