Unityはオブジェクトの色を変更します

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Change_Color : MonoBehaviour {
    
    
    void Start() {
    
    
        GameObject Cube =  GameObject.CreatePrimitive(PrimitiveType.Cylinder);
        Cube.GetComponent<Renderer>().material.color = new Color(1,0,0);  // 重点是这一句
    }
    void Update() {
    
    

    }
}

参考:https://blog.csdn.net/weixin_44345862/article/details/122115404

おすすめ

転載: blog.csdn.net/gls_nuaa/article/details/132019363
おすすめ