using UnityEngine;
using System.Collections;
public class t1 : MonoBehaviour {
public int t11;
// Use this for initialization
void Start () {
InvokeRepeating("close",0.01f,1f);
}
// Update is called once per frame
void Update () {
}
void close()
{
t11++;
}
}
using UnityEngine;
using System.Collections;
public class t2 : MonoBehaviour {
public t1 cp;
// Use this for initialization
public int i;
void Start () {
cp=GetComponent<t1>();
InvokeRepeating("close",0.01f,1f);
}
// Update is called once per frame
void Update()
{
i=cp.t11;
}
}