如何在脚本中向游戏对象添加材质?

时间:2018-07-18 16:32:58

标签: c# unity3d

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

public class AgentControl : MonoBehaviour
{
    public List<Transform> points = new List<Transform>();
    public bool randomMeeting = false;
    public float threshold = 3f;
    public float strength = 5f;

    private float speed;
    private int destPoint = 0;
    private NavMeshAgent agent;
    private GameObject[] agents;

    void Start()
    {

    }

我不想公开材料垫;然后在编辑器中向对象添加材料。我想在脚本中创建材质,然后将其作为组件自身添加到脚本中。

0 个答案:

没有答案