예제 #1
0
 void Start()
 {
     Tutorialtext = transform.GetChild(1).GetComponent <Text>();
     dataText     = (TextAsset)Resources.Load("TextCsv/TutorialDialog");
     string[] st = dataText.text.Split('*');
     data = new List <string[]>();
     for (int i = 0; i < st.Length; i++)
     {
         data.Add(st[i].Split(','));
     }
     Tutorialtext.text     = data[dialogLine][1];
     BKImage               = transform.Find("Bk").GetComponent <Image>();
     requestImage          = transform.Find("RequestImage").GetComponent <Image>();
     requestImageLast      = transform.Find("RequestImageLast").GetComponent <Image>();
     crafterConfirm        = transform.Find("CrafterConfirm").GetComponent <Image>();
     attackerConfirm       = transform.Find("AttackerConfirm").GetComponent <Image>();
     craftRequestNumber    = transform.Find("CrafterRequest").GetComponent <Text>();
     attackerRequestNumber = transform.Find("AttackerRequest").GetComponent <Text>();
     pickItemSystem        = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>();
     enemySystem           = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>();
     lastRequestPos        = requestImageLast.transform.position;
     progress              = -1;
     currentRequestPos     = requestImageLast.transform.position;
     lastRequestPos        = requestImage.transform.position;
 }
예제 #2
0
 // Use this for initialization
 void Awake()
 {
     pickItemSystem = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>();
     mapInfo        = GameObject.Find("map").GetComponent <MapInfo>();
     freePoisons    = new List <Poison>();
     usedPoisons    = new List <Poison>();
     for (int i = 0; i < transform.childCount; i++)
     {
         Transform temp = transform.GetChild(i);
         freePoisons.Add(temp.GetComponent <Poison>());
         freePoisons[freePoisons.Count - 1].system = this;
         temp.gameObject.SetActive(false);
         freeNum++;
     }
 }
예제 #3
0
 // Use this for initialization
 public override void Awake()
 {
     base.Awake();
     hp        = 25;
     lastState = -1;
     state     = 0;
     //box1 = transform.Find("PlayerDetect").GetChild(0).GetComponent<BoxCollider2D>();
     // box2 = transform.Find("PlayerDetect").GetChild(1).GetComponent<BoxCollider2D>();
     //behavior_chance = new float[6] {0.4f,0.8f,1.0f,0,0,0};
     scaleX         = transform.localScale.x;
     scaleY         = transform.localScale.y;
     thunders       = transform.parent.Find("Thunders").GetComponent <CChildProjectSystem>();
     rigBody        = this.GetComponent <Rigidbody2D>();
     getHurtEffect  = GetComponent <GetHurtEffect>();
     pickItemSystem = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>();
 }
예제 #4
0
 // Use this for initialization
 void Awake()
 {
     items  = new CItem[total_num];
     images = new SpriteRenderer[total_num];
     fire   = transform.Find("fire");
     for (int i = 0; i < total_num; i++)
     {
         //Debug.Log(i);
         images[i]         = transform.GetChild(1).transform.GetChild(i).GetChild(0).GetComponent <SpriteRenderer>();
         images[i].enabled = false;
     }
     animator       = this.GetComponent <Animator>();
     pickItemSystem = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>();
     enemySystem    = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>();
     hint           = transform.Find("hint").GetComponent <SpriteRenderer>();
     hint.enabled   = false;
 }
예제 #5
0
 public void SetSystem(CPickItemSystem system)
 {
     this.pickitem_system = system;
 }