using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static productcollection;
public class romdcharacter : MonoBehaviour
{
public GameObject iconofcharacter;//方框1;......
public GameObject iconofthestate1;//方框1的状态
public GameObject iconofthestate2;//方框2的状态
public GameObject iconofthestate3;//方框3的状态
/* private GameObject iconofthestate4;//方框4的状态
private GameObject iconofthestate5;//方框5的状态*/
private int character1;
private void Start()
{
Image photoofc = iconofcharacter.GetComponent<Image>();
Image photoofc1 =iconofthestate1.GetComponent<Image>();//血条
Image photoofc2 = iconofthestate2.GetComponent<Image>();//需求
Image photoofc3 = iconofthestate3.GetComponent<Image>();//好感
为什么之类添加了
Image photoofc2 = iconofthestate2.GetComponent<Image>();//需求
Image photoofc3 = iconofthestate3.GetComponent<Image>();//好感
这一行后就直接连下面的代码都运行不了。已经在unity中附着了gameboject但还是不行
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static productcollection;
public class romdcharacter : MonoBehaviour
{
public GameObject iconofcharacter;//方框1;......
public GameObject iconofthestate1;//方框1的状态
public GameObject iconofthestate2;//方框2的状态
public GameObject iconofthestate3;//方框3的状态
/* private GameObject iconofthestate4;//方框4的状态
private GameObject iconofthestate5;//方框5的状态*/
private int character1;
private void Start()
{
Image photoofc = iconofcharacter.GetComponent<Image>();
Image photoofc1 =iconofthestate1.GetComponent<Image>();//血条
Image photoofc2 = iconofthestate2.GetComponent<Image>();//需求
Image photoofc3 = iconofthestate3.GetComponent<Image>();//好感
为什么之类添加了
Image photoofc2 = iconofthestate2.GetComponent<Image>();//需求
Image photoofc3 = iconofthestate3.GetComponent<Image>();//好感
这一行后就直接连下面的代码都运行不了。已经在unity中附着了gameboject但还是不行